TtImageLoader
object TtImageLoader
Facilitates downloading drawables from remote locations.
Functions
Link copied to clipboard
fun download(context: Context, remoteImage: RemoteImage, targetView: View? = null): LiveData<Drawable>
A function to get the Drawable from the provided remoteImage. The optional targetView is used to determine the expected Drawable size which fits the targetView.
fun download(context: Context, uri: Uri, placeholder: Drawable? = null, fallback: Drawable? = null, targetView: View? = null): LiveData<Drawable>
A function to get the Drawable from the provided uri. The optional targetView is used to determine the expected Drawable size which fits the targetView.
Link copied to clipboard
A suspend function to get the Drawable from the provided uri. The optional targetView is used to determine the expected Drawable size which fits the targetView. When the downloading success, it returns a Result.success and a Result.failure when the downloading fails.