Package-level declarations

Types

Link copied to clipboard
Helper for accessing features in android.graphics.drawable.Drawable.
Link copied to clipboard
Helper for accessing features in android.graphics.drawable.Icon.
Link copied to clipboard
A Drawable that wraps a bitmap and can be drawn with rounded corners.
Link copied to clipboard
Constructs RoundedBitmapDrawable objects, either from Bitmaps directly, or from streams and files.
Link copied to clipboard
Interface which allows a android.graphics.drawable.Drawable to receive tinting calls from DrawableCompat.
Link copied to clipboard
Interface which allows a android.graphics.drawable.Drawable to get/set wrapped drawables from DrawableCompat.

Functions

Link copied to clipboard
@RequiresApi(value = 26)
inline fun Bitmap.toAdaptiveIcon(): Icon

Create an Icon from this adaptive Bitmap.

Link copied to clipboard
fun Drawable.toBitmap(@Px width: Int = intrinsicWidth, @Px height: Int = intrinsicHeight, config: Bitmap.Config? = null): Bitmap

Return a Bitmap representation of this Drawable.

Link copied to clipboard
fun Drawable.toBitmapOrNull(@Px width: Int = intrinsicWidth, @Px height: Int = intrinsicHeight, config: Bitmap.Config? = null): Bitmap?

Returns a Bitmap representation of this Drawable or null if the drawable cannot be represented as a bitmap.

Link copied to clipboard
@RequiresApi(value = 26)
inline fun Color.toDrawable(): ColorDrawable

Create a ColorDrawable from this Color (via Color.toArgb).

Create a ColorDrawable from this color value.

inline fun Bitmap.toDrawable(resources: Resources): BitmapDrawable

Create a BitmapDrawable from this Bitmap.

Link copied to clipboard
@RequiresApi(value = 26)
inline fun Bitmap.toIcon(): Icon

Create an Icon from this Bitmap.

@RequiresApi(value = 26)
inline fun Uri.toIcon(): Icon

Create an Icon from this Uri.

@RequiresApi(value = 26)
inline fun ByteArray.toIcon(): Icon

Create an Icon from this ByteArray.

Link copied to clipboard
fun Drawable.updateBounds(@Px left: Int = bounds.left, @Px top: Int = bounds.top, @Px right: Int = bounds.right, @Px bottom: Int = bounds.bottom)

Updates this drawable's bounds. This version of the method allows using named parameters to just set one or more axes.