Last active
August 27, 2018 15:55
-
-
Save SeongUgJung/33137e7c10426d51663d95098bda99a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindingAdapter({"bindUri", "bindImageLoader"}, requireAll = true) | |
fun loadImage(view: ImageView, uri : String, imageLoader : ImageLoader) { | |
imageLoader.load(uri).into(view) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
> | |
<data> | |
<variable name="vm" type="MainViewModel" /> | |
</data> | |
<ImageView | |
android:layout_width="50dp" | |
android:layout_height="50dp" | |
app:bindImageLoader="@{vm.imageLoader}" | |
app:bindUri="@{vm.imageUri}" | |
/> | |
</layout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment