Package-level declarations

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.