loadImage

inline fun AvatarView.loadImage(data: Any?, crossinline onStart: () -> Unit = {}, crossinline onComplete: () -> Unit = {}, noinline onSuccess: (request: ImageRequest, metadata: ImageResult.Metadata) -> Unit = { _, _ -> }, noinline onError: (request: ImageRequest, throwable: Throwable) -> Unit = { _, _ -> }, builder: ImageRequest.Builder.() -> Unit = {})

Loads an image request data to the AvatarView.

Parameters

data

An image data to be loaded.

onStart

A lambda function will be executed when start requesting.

onComplete

A lambda function will be executed when loading finished.

onSuccess

A lambda function will be executed when loading succeeds.

onError

A lambda function will be executed when loading failed.

builder

A receiver to be applied with the ImageRequest.Builder.


inline fun AvatarView.loadImage(data: List<Any?>, crossinline onStart: () -> Unit = {}, crossinline onComplete: () -> Unit = {}, noinline onSuccess: (request: ImageRequest, metadata: ImageResult.Metadata) -> Unit = { _, _ -> }, noinline onError: (request: ImageRequest, throwable: Throwable) -> Unit = { _, _ -> }, builder: ImageRequest.Builder.() -> Unit = {})

Loads a list of image request data to the AvatarView. Up to 4 images will be combined and loaded.

Parameters

data

A list of image data to be loaded.

onStart

A lambda function will be executed when start requesting.

onComplete

A lambda function will be executed when finish loading.

onSuccess

A lambda function will be executed when loading succeeds.

onError

A lambda function will be executed when loading failed.

builder

A receiver to be applied with the ImageRequest.Builder.


inline fun AvatarView.loadImage(vararg data: Any?, crossinline onStart: () -> Unit = {}, crossinline onComplete: () -> Unit = {}, noinline onSuccess: (request: ImageRequest, metadata: ImageResult.Metadata) -> Unit = { _, _ -> }, noinline onError: (request: ImageRequest, throwable: Throwable) -> Unit = { _, _ -> }, builder: ImageRequest.Builder.() -> Unit = {})

Loads a vararg of image request data to the AvatarView. Up to 4 images will be combined and loaded.

Parameters

data

A vararg of image data to be loaded.

onStart

A lambda function will be executed when start requesting.

onComplete

A lambda function will be executed when finish loading.

onSuccess

A lambda function will be executed when loading succeeds.

onError

A lambda function will be executed when loading failed.

builder

A receiver to be applied with the ImageRequest.Builder.