Drawable Utils
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
open fun createTintableDrawableIfNeeded(@Nullable drawable: Drawable, @Nullable tintList: ColorStateList, @Nullable tintMode: PorterDuff.Mode): Drawable
Wraps and mutates the passed in drawable so that it may be used for tinting if a tintList is present.
Link copied to clipboard
open fun createTintableMutatedDrawableIfNeeded(@Nullable drawable: Drawable, @Nullable tintList: ColorStateList, @Nullable tintMode: PorterDuff.Mode): Drawable
Wraps and mutates the passed in drawable so that it may be used for tinting if a tintList is present.
Link copied to clipboard
Link copied to clipboard
Returns the ColorStateList if it can be retrieved from the
drawable, or null otherwise.Link copied to clipboard
Link copied to clipboard
open fun parseDrawableXml(@NonNull context: Context, @XmlRes id: Int, @NonNull startTag: CharSequence): AttributeSet
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun updateTintFilter(@NonNull drawable: Drawable, @Nullable tint: ColorStateList, @Nullable tintMode: PorterDuff.Mode): PorterDuffColorFilter
Returns a tint filter for the given tint and mode.