fetchScaledDrawable

open fun fetchScaledDrawable(@NonNull context: Context, @NonNull url: URL, reqWidth: Int, reqHeight: Int): ImageUtils.DrawableResult

Fetches a drawable from an image path.

Return

The result or null if the file was unable to be downloaded.

Parameters

context

The application context.

url

The URL.

reqWidth

The requested width of the image.

reqHeight

The requested height of the image.

Throws

if file fails to be created.


open fun fetchScaledDrawable(@NonNull context: Context, @NonNull url: URL, reqWidth: Int, reqHeight: Int, fallbackWidth: Int, fallbackHeight: Int): ImageUtils.DrawableResult

Fetches a drawable from an image path, using the supplied fallback dimensions if the ImageView reports a width or height of zero. Setting the fallback dimensions to -1 will automatically calculate zero dimensions based on the aspect ratio of the image.

Return

The result or null if the file was unable to be downloaded.

Parameters

context

The application context.

url

The URL.

reqWidth

The requested width of the image.

reqHeight

The requested height of the image.

fallbackWidth

The width dimension to be used if the ImageView reports a width of zero.

fallbackHeight

The height dimension to be used if the ImageView reports a height of zero.

Throws

if file fails to be created.