public class LayerDrawable extends Drawable implements Drawable.Callback
It can be defined in an XML file with the <layer-list>
element.
Each Drawable in the layer is defined in a nested <item>
.
For more information, see the guide to Drawable Resources.
Drawable.Callback, Drawable.ConstantState
Modifier and Type | Field and Description |
---|---|
static int |
INSET_UNDEFINED
Value used for undefined start and end insets.
|
static int |
PADDING_MODE_NEST
Padding mode used to nest each layer inside the padding of the previous
layer.
|
static int |
PADDING_MODE_STACK
Padding mode used to stack each layer directly atop the previous layer.
|
Constructor and Description |
---|
LayerDrawable(Drawable[] layers)
Creates a new layer drawable with the list of specified layers.
|
Modifier and Type | Method and Description |
---|---|
int |
addLayer(Drawable dr)
Adds a new layer containing the specified
drawable to the end of
the layer list and returns its index. |
void |
applyTheme(Resources.Theme t)
Applies the specified theme to this Drawable and its children.
|
boolean |
canApplyTheme() |
void |
clearMutated()
Clears the mutated state, allowing this drawable to be cached and
mutated again.
|
void |
draw(Canvas canvas)
Draw in its bounds (set via setBounds) respecting optional effects such
as alpha (set via setAlpha) and color filter (set via setColorFilter).
|
Drawable |
findDrawableByLayerId(int id)
Looks for a layer with the given ID and returns its
Drawable . |
int |
findIndexByLayerId(int id)
Returns the layer with the specified
id . |
int |
getAlpha()
Gets the current alpha value for the drawable. 0 means fully transparent,
255 means fully opaque.
|
int |
getBottomPadding()
Returns the bottom padding in pixels.
|
int |
getChangingConfigurations()
Return a mask of the configuration parameters for which this drawable
may change, requiring that it be re-created.
|
Drawable.ConstantState |
getConstantState()
Return a
Drawable.ConstantState instance that holds the shared state of this Drawable. |
Drawable |
getDrawable(int index)
Returns the drawable for the layer at the specified index.
|
int |
getEndPadding()
Returns the end padding in pixels.
|
void |
getHotspotBounds(Rect outRect)
Populates
outRect with the hotspot bounds. |
int |
getId(int index)
Returns the ID of the specified layer.
|
int |
getIntrinsicHeight()
Returns the drawable's intrinsic height.
|
int |
getIntrinsicWidth()
Returns the drawable's intrinsic width.
|
int |
getLayerGravity(int index) |
int |
getLayerHeight(int index) |
int |
getLayerInsetBottom(int index) |
int |
getLayerInsetEnd(int index) |
int |
getLayerInsetLeft(int index) |
int |
getLayerInsetRight(int index) |
int |
getLayerInsetStart(int index) |
int |
getLayerInsetTop(int index) |
int |
getLayerWidth(int index) |
int |
getLeftPadding()
Returns the left padding in pixels.
|
int |
getNumberOfLayers()
Returns the number of layers contained within this layer drawable.
|
int |
getOpacity()
Return the opacity/transparency of this Drawable.
|
void |
getOutline(Outline outline)
Populates
outline with the first available (non-empty) layer outline. |
boolean |
getPadding(Rect padding)
Return in padding the insets suggested by this Drawable for placing
content inside the drawable's bounds.
|
int |
getPaddingMode() |
int |
getRightPadding()
Returns the right padding in pixels.
|
int |
getStartPadding()
Returns the start padding in pixels.
|
int |
getTopPadding()
Returns the top padding in pixels.
|
void |
inflate(Resources r,
XmlPullParser parser,
AttributeSet attrs,
Resources.Theme theme)
Inflate this Drawable from an XML resource optionally styled by a theme.
|
void |
invalidateDrawable(Drawable who)
Called when the drawable needs to be redrawn.
|
boolean |
isAutoMirrored()
Tells if this Drawable will be automatically mirrored when its layout direction is RTL
right-to-left.
|
boolean |
isProjected()
Whether this drawable requests projection.
|
boolean |
isStateful()
Indicates whether this drawable will change its appearance based on
state.
|
void |
jumpToCurrentState()
If this Drawable does transition animations between states, ask that
it immediately jump to the current state and skip any active animations.
|
Drawable |
mutate()
Make this drawable mutable.
|
protected void |
onBoundsChange(Rect bounds)
Override this in your subclass to change appearance if you vary based on
the bounds.
|
boolean |
onLayoutDirectionChanged(int layoutDirection)
Called when the drawable's resolved layout direction changes.
|
protected boolean |
onLevelChange(int level)
Override this in your subclass to change appearance if you vary based
on level.
|
protected boolean |
onStateChange(int[] state)
Override this in your subclass to change appearance if you recognize the
specified state.
|
void |
scheduleDrawable(Drawable who,
Runnable what,
long when)
A Drawable can call this to schedule the next frame of its
animation.
|
void |
setAlpha(int alpha)
Specify an alpha value for the drawable. 0 means fully transparent, and
255 means fully opaque.
|
void |
setAutoMirrored(boolean mirrored)
Set whether this Drawable is automatically mirrored when its layout direction is RTL
(right-to left).
|
void |
setColorFilter(ColorFilter colorFilter)
Specify an optional color filter for the drawable.
|
void |
setDither(boolean dither)
Set to true to have the drawable dither its colors when drawn to a
device with fewer than 8-bits per color component.
|
void |
setDrawable(int index,
Drawable drawable)
Sets the drawable for the layer at the specified index.
|
boolean |
setDrawableByLayerId(int id,
Drawable drawable)
Replaces the
Drawable for the layer with the given id. |
void |
setHotspot(float x,
float y)
Specifies the hotspot's location within the drawable.
|
void |
setHotspotBounds(int left,
int top,
int right,
int bottom)
Sets the bounds to which the hotspot is constrained, if they should be
different from the drawable bounds.
|
void |
setId(int index,
int id)
Sets the ID of a layer.
|
void |
setLayerGravity(int index,
int gravity)
Sets the gravity used to position or stretch the specified layer within
its container.
|
void |
setLayerHeight(int index,
int h) |
void |
setLayerInset(int index,
int l,
int t,
int r,
int b)
Specifies the insets in pixels for the drawable at the specified index.
|
void |
setLayerInsetBottom(int index,
int b) |
void |
setLayerInsetEnd(int index,
int e) |
void |
setLayerInsetLeft(int index,
int l) |
void |
setLayerInsetRelative(int index,
int s,
int t,
int e,
int b)
Specifies the relative insets in pixels for the drawable at the
specified index.
|
void |
setLayerInsetRight(int index,
int r) |
void |
setLayerInsetStart(int index,
int s) |
void |
setLayerInsetTop(int index,
int t) |
void |
setLayerSize(int index,
int w,
int h)
Sets an explicit size for the specified layer.
|
void |
setLayerWidth(int index,
int w) |
void |
setOpacity(int opacity)
Sets the opacity of this drawable directly instead of collecting the
states from the layers.
|
void |
setPadding(int left,
int top,
int right,
int bottom)
Sets the absolute padding.
|
void |
setPaddingMode(int mode)
Specifies how layer padding should affect the bounds of subsequent
layers.
|
void |
setPaddingRelative(int start,
int top,
int end,
int bottom)
Sets the relative padding.
|
void |
setTintList(ColorStateList tint)
Specifies tint color for this drawable as a color state list.
|
void |
setTintMode(PorterDuff.Mode tintMode)
Specifies a tint blending mode for this drawable.
|
boolean |
setVisible(boolean visible,
boolean restart)
Set whether this Drawable is visible.
|
void |
unscheduleDrawable(Drawable who,
Runnable what)
A Drawable can call this to unschedule an action previously
scheduled with
Drawable.Callback.scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long) . |
clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getCallback, getColorFilter, getCurrent, getDirtyBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getState, getTransparentRegion, inflate, invalidateSelf, isFilterBitmap, isVisible, obtainAttributes, parseTintMode, resolveOpacity, scheduleSelf, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setFilterBitmap, setLayoutDirection, setLevel, setState, setTint, setXfermode, unscheduleSelf
public static final int PADDING_MODE_NEST
setPaddingMode(int)
,
Constant Field Valuespublic static final int PADDING_MODE_STACK
setPaddingMode(int)
,
Constant Field Valuespublic static final int INSET_UNDEFINED
public LayerDrawable(Drawable[] layers)
layers
- a list of drawables to use as layers in this new drawable,
must be non-nullpublic void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException
Drawable
inflate
in class Drawable
r
- Resources used to resolve attribute valuesparser
- XML parser from which to inflate this Drawableattrs
- Base set of attribute valuestheme
- Theme to apply, may be nullXmlPullParserException
IOException
public void applyTheme(Resources.Theme t)
Drawable
applyTheme
in class Drawable
t
- the theme to applypublic boolean canApplyTheme()
canApplyTheme
in class Drawable
public boolean isProjected()
Drawable
isProjected
in class Drawable
public int addLayer(Drawable dr)
drawable
to the end of
the layer list and returns its index.dr
- The drawable to add as a new layer.public Drawable findDrawableByLayerId(int id)
Drawable
.
If multiple layers are found for the given ID, returns the
Drawable
for the matching layer at the highest index.
id
- The layer ID to search for.Drawable
for the highest-indexed layer that has the
given ID, or null if not found.public void setId(int index, int id)
index
- The index of the layer to modify, must be in the range
0...getNumberOfLayers()-1
.id
- The id to assign to the layer.getId(int)
public int getId(int index)
index
- The index of the layer, must be in the range
0...getNumberOfLayers()-1
.View.NO_ID
if the
layer has no id.setId(int, int)
public int getNumberOfLayers()
public boolean setDrawableByLayerId(int id, Drawable drawable)
Drawable
for the layer with the given id.public int findIndexByLayerId(int id)
id
.
If multiple layers have the same ID, returns the layer with the lowest index.
id
- The ID of the layer to return.public void setDrawable(int index, Drawable drawable)
index
- The index of the layer to modify, must be in the range
0...getNumberOfLayers()-1
.drawable
- The drawable to set for the layer.getDrawable(int)
public Drawable getDrawable(int index)
index
- The index of the layer, must be in the range
0...getNumberOfLayers()-1
.Drawable
at the specified layer index.setDrawable(int, Drawable)
public void setLayerSize(int index, int w, int h)
Note: Setting an explicit layer size changes the
default layer gravity behavior. See setLayerGravity(int, int)
for more information.
index
- the index of the layer to adjustw
- width in pixels, or -1 to use the intrinsic widthh
- height in pixels, or -1 to use the intrinsic heightgetLayerWidth(int)
,
getLayerHeight(int)
public void setLayerWidth(int index, int w)
index
- the index of the layer to adjustw
- width in pixels, or -1 to use the intrinsic widthpublic int getLayerWidth(int index)
index
- the index of the drawable to adjustsetLayerSize(int, int, int)
public void setLayerHeight(int index, int h)
index
- the index of the layer to adjusth
- height in pixels, or -1 to use the intrinsic heightpublic int getLayerHeight(int index)
index
- the index of the drawable to adjustsetLayerSize(int, int, int)
public void setLayerGravity(int index, int gravity)
setLayerInset(int, int, int, int, int)
) or padding (see
setPaddingMode(int)
).
If gravity is specified as Gravity.NO_GRAVITY
, the default
behavior depends on whether an explicit width or height has been set
(see setLayerSize(int, int, int)
), If a dimension is not set,
gravity in that direction defaults to Gravity.FILL_HORIZONTAL
or
Gravity.FILL_VERTICAL
; otherwise, gravity in that direction
defaults to Gravity.LEFT
or Gravity.TOP
.
index
- the index of the drawable to adjustgravity
- the gravity to set for the layergetLayerGravity(int)
public int getLayerGravity(int index)
index
- the index of the layersetLayerGravity(int, int)
public void setLayerInset(int index, int l, int t, int r, int b)
index
- the index of the drawable to adjustl
- number of pixels to add to the left boundt
- number of pixels to add to the top boundr
- number of pixels to subtract from the right boundb
- number of pixels to subtract from the bottom boundpublic void setLayerInsetRelative(int index, int s, int t, int e, int b)
index
- the index of the layer to adjusts
- number of pixels to inset from the start boundt
- number of pixels to inset from the top bounde
- number of pixels to inset from the end boundb
- number of pixels to inset from the bottom boundpublic void setLayerInsetLeft(int index, int l)
index
- the index of the layer to adjustl
- number of pixels to inset from the left boundpublic int getLayerInsetLeft(int index)
index
- the index of the layerpublic void setLayerInsetRight(int index, int r)
index
- the index of the layer to adjustr
- number of pixels to inset from the right boundpublic int getLayerInsetRight(int index)
index
- the index of the layerpublic void setLayerInsetTop(int index, int t)
index
- the index of the layer to adjustt
- number of pixels to inset from the top boundpublic int getLayerInsetTop(int index)
index
- the index of the layerpublic void setLayerInsetBottom(int index, int b)
index
- the index of the layer to adjustb
- number of pixels to inset from the bottom boundpublic int getLayerInsetBottom(int index)
index
- the index of the layerpublic void setLayerInsetStart(int index, int s)
index
- the index of the layer to adjusts
- number of pixels to inset from the start boundpublic int getLayerInsetStart(int index)
index
- the index of the layerINSET_UNDEFINED
if not specifiedpublic void setLayerInsetEnd(int index, int e)
index
- the index of the layer to adjuste
- number of pixels to inset from the end bound, or
INSET_UNDEFINED
if not specifiedpublic int getLayerInsetEnd(int index)
index
- the index of the layerpublic void setPaddingMode(int mode)
PADDING_MODE_NEST
.mode
- padding mode, one of:
PADDING_MODE_NEST
to nest each layer inside the
padding of the previous layer
PADDING_MODE_STACK
to stack each layer directly
atop the previous layer
getPaddingMode()
public int getPaddingMode()
setPaddingMode(int)
public void invalidateDrawable(Drawable who)
Drawable.Callback
invalidateDrawable
in interface Drawable.Callback
who
- The drawable that is requesting the update.public void scheduleDrawable(Drawable who, Runnable what, long when)
Drawable.Callback
Handler.postAtTime(Runnable, Object, long)
with
the parameters (what, who, when) to perform the
scheduling.scheduleDrawable
in interface Drawable.Callback
who
- The drawable being scheduled.what
- The action to execute.when
- The time (in milliseconds) to run. The timebase is
SystemClock.uptimeMillis()
public void unscheduleDrawable(Drawable who, Runnable what)
Drawable.Callback
Drawable.Callback.scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long)
. An implementation can
generally simply call
Handler.removeCallbacks(Runnable, Object)
with
the parameters (what, who) to unschedule the drawable.unscheduleDrawable
in interface Drawable.Callback
who
- The drawable being unscheduled.what
- The action being unscheduled.public void draw(Canvas canvas)
Drawable
public int getChangingConfigurations()
Drawable
Drawable.setChangingConfigurations(int)
or 0 by default. Subclasses
may extend this to or in the changing configurations of any other
drawables they hold.getChangingConfigurations
in class Drawable
ActivityInfo
.ActivityInfo
public boolean getPadding(Rect padding)
Drawable
getPadding
in class Drawable
public void setPadding(int left, int top, int right, int bottom)
If padding in a dimension is specified as -1
, the resolved
padding will use the value computed according to the padding mode (see
setPaddingMode(int)
).
Calling this method clears any relative padding values previously set
using setPaddingRelative(int, int, int, int)
.
left
- the left padding in pixels, or -1 to use computed paddingtop
- the top padding in pixels, or -1 to use computed paddingright
- the right padding in pixels, or -1 to use computed paddingbottom
- the bottom padding in pixels, or -1 to use computed
paddingsetPaddingRelative(int, int, int, int)
public void setPaddingRelative(int start, int top, int end, int bottom)
If padding in a dimension is specified as -1
, the resolved
padding will use the value computed according to the padding mode (see
setPaddingMode(int)
).
Calling this method clears any absolute padding values previously set
using setPadding(int, int, int, int)
.
start
- the start padding in pixels, or -1 to use computed paddingtop
- the top padding in pixels, or -1 to use computed paddingend
- the end padding in pixels, or -1 to use computed paddingbottom
- the bottom padding in pixels, or -1 to use computed
paddingsetPadding(int, int, int, int)
public int getLeftPadding()
A return value of -1
means there is no explicit padding set for
this dimension. As a result, the value for this dimension returned by
getPadding(Rect)
will be computed from the child layers
according to the padding mode (see getPaddingMode()
.
setPadding(int, int, int, int)
,
getPadding(Rect)
public int getRightPadding()
A return value of -1
means there is no explicit padding set for
this dimension. As a result, the value for this dimension returned by
getPadding(Rect)
will be computed from the child layers
according to the padding mode (see getPaddingMode()
.
setPadding(int, int, int, int)
,
getPadding(Rect)
public int getStartPadding()
A return value of -1
means there is no explicit padding set for
this dimension. As a result, the value for this dimension returned by
getPadding(Rect)
will be computed from the child layers
according to the padding mode (see getPaddingMode()
.
setPaddingRelative(int, int, int, int)
,
getPadding(Rect)
public int getEndPadding()
A return value of -1
means there is no explicit padding set for
this dimension. As a result, the value for this dimension returned by
getPadding(Rect)
will be computed from the child layers
according to the padding mode (see getPaddingMode()
.
setPaddingRelative(int, int, int, int)
,
getPadding(Rect)
public int getTopPadding()
A return value of -1
means there is no explicit padding set for
this dimension. As a result, the value for this dimension returned by
getPadding(Rect)
will be computed from the child layers
according to the padding mode (see getPaddingMode()
.
setPadding(int, int, int, int)
,
setPaddingRelative(int, int, int, int)
,
getPadding(Rect)
public int getBottomPadding()
A return value of -1
means there is no explicit padding set for
this dimension. As a result, the value for this dimension returned by
getPadding(Rect)
will be computed from the child layers
according to the padding mode (see getPaddingMode()
.
setPadding(int, int, int, int)
,
setPaddingRelative(int, int, int, int)
,
getPadding(Rect)
public void getOutline(Outline outline)
outline
with the first available (non-empty) layer outline.getOutline
in class Drawable
outline
- Outline in which to place the first available layer outlineView.setOutlineProvider(android.view.ViewOutlineProvider)
public void setHotspot(float x, float y)
Drawable
setHotspot
in class Drawable
x
- The X coordinate of the center of the hotspoty
- The Y coordinate of the center of the hotspotpublic void setHotspotBounds(int left, int top, int right, int bottom)
Drawable
setHotspotBounds
in class Drawable
left
- position in pixels of the left boundtop
- position in pixels of the top boundright
- position in pixels of the right boundbottom
- position in pixels of the bottom boundDrawable.getHotspotBounds(android.graphics.Rect)
public void getHotspotBounds(Rect outRect)
Drawable
outRect
with the hotspot bounds.getHotspotBounds
in class Drawable
outRect
- the rect to populate with the hotspot boundsDrawable.setHotspotBounds(int, int, int, int)
public boolean setVisible(boolean visible, boolean restart)
Drawable
setVisible
in class Drawable
visible
- Set to true if visible, false if not.restart
- You can supply true here to force the drawable to behave
as if it has just become visible, even if it had last
been set visible. Used for example to force animations
to restart.public void setDither(boolean dither)
Drawable
setDither
in class Drawable
Paint.setDither(boolean);
public void setAlpha(int alpha)
Drawable
public int getAlpha()
Drawable
public void setColorFilter(ColorFilter colorFilter)
Drawable
If a Drawable has a ColorFilter, each output pixel of the Drawable's drawing contents will be modified by the color filter before it is blended onto the render target of a Canvas.
Pass null
to remove any existing color filter.
Note: Setting a non-null
color
filter disables tint
.
setColorFilter
in class Drawable
colorFilter
- The color filter to apply, or null
to remove the
existing color filterpublic void setTintList(ColorStateList tint)
Drawable
A Drawable's drawing content will be blended together with its tint
before it is drawn to the screen. This functions similarly to
Drawable.setColorFilter(int, PorterDuff.Mode)
.
Note: Setting a color filter via
Drawable.setColorFilter(ColorFilter)
or
Drawable.setColorFilter(int, PorterDuff.Mode)
overrides tint.
setTintList
in class Drawable
tint
- Color state list to use for tinting this drawable, or
null
to clear the tintDrawable.setTint(int)
,
Drawable.setTintMode(PorterDuff.Mode)
public void setTintMode(PorterDuff.Mode tintMode)
Drawable
Defines how this drawable's tint color should be blended into the drawable
before it is drawn to screen. Default tint mode is PorterDuff.Mode#SRC_IN
.
Note: Setting a color filter via
Drawable.setColorFilter(ColorFilter)
or
Drawable.setColorFilter(int, PorterDuff.Mode)
overrides tint.
setTintMode
in class Drawable
tintMode
- A Porter-Duff blending modeDrawable.setTint(int)
,
Drawable.setTintList(ColorStateList)
public void setOpacity(int opacity)
opacity
- The opacity to use, or PixelFormat.UNKNOWN
for the default behaviorPixelFormat.UNKNOWN
,
PixelFormat.TRANSLUCENT
,
PixelFormat.TRANSPARENT
,
PixelFormat.OPAQUE
public int getOpacity()
Drawable
PixelFormat
:
PixelFormat.UNKNOWN
,
PixelFormat.TRANSLUCENT
,
PixelFormat.TRANSPARENT
, or
PixelFormat.OPAQUE
.
An OPAQUE drawable is one that draws all all content within its bounds, completely covering anything behind the drawable. A TRANSPARENT drawable is one that draws nothing within its bounds, allowing everything behind it to show through. A TRANSLUCENT drawable is a drawable in any other state, where the drawable will draw some, but not all, of the content within its bounds and at least some content behind the drawable will be visible. If the visibility of the drawable's contents cannot be determined, the safest/best return value is TRANSLUCENT.
Generally a Drawable should be as conservative as possible with the
value it returns. For example, if it contains multiple child drawables
and only shows one of them at a time, if only one of the children is
TRANSLUCENT and the others are OPAQUE then TRANSLUCENT should be
returned. You can use the method Drawable.resolveOpacity(int, int)
to perform a
standard reduction of two opacities to the appropriate single output.
Note that the returned value does not necessarily take into account a
custom alpha or color filter that has been applied by the client through
the Drawable.setAlpha(int)
or Drawable.setColorFilter(android.graphics.ColorFilter)
methods. Some subclasses,
such as BitmapDrawable
, ColorDrawable
, and GradientDrawable
,
do account for the value of Drawable.setAlpha(int)
, but the general behavior is dependent
upon the implementation of the subclass.
getOpacity
in class Drawable
PixelFormat
public void setAutoMirrored(boolean mirrored)
Drawable
LayoutDirection
.setAutoMirrored
in class Drawable
mirrored
- Set to true if the Drawable should be mirrored, false if not.public boolean isAutoMirrored()
Drawable
LayoutDirection
.isAutoMirrored
in class Drawable
public void jumpToCurrentState()
Drawable
jumpToCurrentState
in class Drawable
public boolean isStateful()
Drawable
isStateful
in class Drawable
Drawable.setState(int[])
protected boolean onStateChange(int[] state)
Drawable
onStateChange
in class Drawable
protected boolean onLevelChange(int level)
Drawable
onLevelChange
in class Drawable
protected void onBoundsChange(Rect bounds)
Drawable
onBoundsChange
in class Drawable
public int getIntrinsicWidth()
Drawable
Intrinsic width is the width at which the drawable would like to be laid out, including any inherent padding. If the drawable has no intrinsic width, such as a solid color, this method returns -1.
getIntrinsicWidth
in class Drawable
public int getIntrinsicHeight()
Drawable
Intrinsic height is the height at which the drawable would like to be laid out, including any inherent padding. If the drawable has no intrinsic height, such as a solid color, this method returns -1.
getIntrinsicHeight
in class Drawable
public Drawable.ConstantState getConstantState()
Drawable
Drawable.ConstantState
instance that holds the shared state of this Drawable.getConstantState
in class Drawable
Drawable.ConstantState
,
Drawable.mutate()
public Drawable mutate()
Drawable
mutate
in class Drawable
Drawable.ConstantState
,
Drawable.getConstantState()
public void clearMutated()
Drawable
This is hidden because only framework drawables can be cached, so custom drawables don't need to support constant state, mutate(), or clearMutated().
clearMutated
in class Drawable
public boolean onLayoutDirectionChanged(int layoutDirection)
Drawable
onLayoutDirectionChanged
in class Drawable
layoutDirection
- the new resolved layout directiontrue
if the layout direction change has caused the
appearance of the drawable to change such that it needs to be
re-drawn, false
otherwiseDrawable.setLayoutDirection(int)