DrawableUtils

Utils class for Drawables.

Properties

Link copied to clipboard
Indicates to use the intrinsic size of the Drawable.

Functions

Link copied to clipboard
open fun compositeTwoLayeredDrawable(@Nullable bottomLayerDrawable: Drawable, @Nullable topLayerDrawable: Drawable): Drawable
Composites two drawables, returning a drawable instance of LayerDrawable, with the top layer centered.
open fun compositeTwoLayeredDrawable(@Nullable bottomLayerDrawable: Drawable, @Nullable topLayerDrawable: Drawable, @Px topLayerDesiredWidth: Int, @Px topLayerDesiredHeight: Int): Drawable
Composites two drawables, returning a drawable instance of LayerDrawable, with the top layer centered to the bottom layer.
Link copied to clipboard
Wraps and mutates the passed in drawable so that it may be used for tinting if a tintList is present.
Link copied to clipboard
Wraps and mutates the passed in drawable so that it may be used for tinting if a tintList is present.
Link copied to clipboard
Returns a new state that adds the checked state to the input state.
Link copied to clipboard
Returns the ColorStateList if it can be retrieved from the drawable, or null otherwise.
Link copied to clipboard
Returns a new state that removes the checked state from the input state.
Link copied to clipboard
Link copied to clipboard
open fun setOutlineToPath(@NonNull outline: Outline, @NonNull path: Path)
Sets the Outline to a path, if possible.
Link copied to clipboard
open fun setRippleDrawableRadius(@Nullable drawable: RippleDrawable, radius: Int)
Link copied to clipboard
open fun setTint(@NonNull drawable: Drawable, @ColorInt color: Int)
Tints the given Drawable with the given color.
Link copied to clipboard
Returns a tint filter for the given tint and mode.