Package com.tomtom.tools.android.api.graphics.drawable

Types

Link copied to clipboard
open class LiveDataDrawable(liveData: LiveData<Drawable>, initialDrawable: Drawable?) : DrawableWrapper

A Drawable that shows the current Drawable value from a liveData instance.

Link copied to clipboard
open class RemoteDrawable(context: Context, uri: Uri, placeholder: Drawable?, targetView: ImageView?) : LiveDataDrawable

A LiveDataDrawable that resolves its LiveData contents from the given URI.

Link copied to clipboard
data class RemoteDrawableResolver(uri: Uri, placeholder: DrawableResolver?) : DrawableResolver

A DrawableResolver that resolves a drawable from the given uri.

Link copied to clipboard
class TextDrawable(context: Context, text: String, @ColorInt textColor: Int) : Drawable

A Drawable that draws the given text. The text will be placed in the center of the drawable's bounding rectangle.

Link copied to clipboard
data class TextDrawableResolver(text: StringResolver, textColor: ColorResolver) : DrawableResolver

A DrawableResolver that creates a Drawable with a text retrieved from a StringResolver.

Functions

Link copied to clipboard
suspend fun Drawable.blur(context: Context, @Px blurRadiusPx: Float, samplingMultiplier: Float = DEFAULT_SAMPLING_MULTIPLIER): Drawable

Creates a blurred version of a drawable.

Link copied to clipboard
fun ImageView.setRemoteDrawable(uri: Uri?, placeholder: Drawable?)
fun ImageView.setRemoteDrawable(uri: Uri?, placeholder: DrawableResolver?)

A convenience binding adapter for setting a RemoteDrawable as the drawable for an ImageView, allowing the uri to be shown in the ImageView. If uri is null or not yet loaded, the placeholder will be shown.