I want to implement custom functions to download image from ImageView
like this app:imageUrl="@{status.imageUrl}"
in the below code:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="status"
type="com.databinding.data.Status" />
</data>
<RelativeLayout
android:id="@+id/status_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/status_avatar"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:contentDescription="@null"
app:imageUrl="@{status.imageUrl}"/>
</RelativeLayout>
</layout>
How to write this function which can download image automate from a @{status.imageUrl}
?
Use this library com.android.databinding
.