TtImageLoader

Facilitates downloading drawables from remote locations.

Functions

Link copied to clipboard
suspend fun downloadImage(context: Context, uri: Uri, targetView: ImageView?): Result<Drawable>

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.