Package-level declarations

Types

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

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

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

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
suspend fun Drawable.getBrightnessAdjustedDominantColor(@ColorInt defaultColor: Int, dispatcher: CoroutineDispatcher = Dispatchers.Default): Int

Returns the drawable's dominant color with a brightness adjustment. If no dominant color is available it falls back to defaultColor. The brightness value of the dominant color is adjusted to an average value in between the original one and the defaultColor brightness value. Therefore, the returned dominant color can be brighter or darker than the original dominant color.