DrawableCompat

public final class DrawableCompat
extends Object

java.lang.Object
   ↳ androidx.core.graphics.drawable.DrawableCompat


Helper for accessing features in Drawable.

Summary

Public methods

static void applyTheme(Drawable drawable, Resources.Theme theme)

Applies the specified theme to this Drawable and its children.

static boolean canApplyTheme(Drawable drawable)

Whether a theme can be applied to this Drawable and its children.

static void clearColorFilter(Drawable drawable)

Removes the color filter from the given drawable.

static int getAlpha(Drawable drawable)

Get the alpha value of the drawable.

static ColorFilter getColorFilter(Drawable drawable)

Returns the current color filter, or null if none set.

static int getLayoutDirection(Drawable drawable)

Returns the resolved layout direction for this Drawable.

static void inflate(Drawable drawable, Resources res, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme)

Inflate this Drawable from an XML resource optionally styled by a theme.

static boolean isAutoMirrored(Drawable drawable)

Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left.

static void jumpToCurrentState(Drawable drawable)

This method is deprecated. Use Drawable.jumpToCurrentState() directly.

static void setAutoMirrored(Drawable drawable, boolean mirrored)

Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left).

static void setHotspot(Drawable drawable, float x, float y)

Specifies the hotspot's location within the drawable.