Java android.graphics.drawable LayerDrawable fields, constructors, methods, implement or subclass

Example usage for Java android.graphics.drawable LayerDrawable fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.graphics.drawable LayerDrawable.

The text is from its open source code.

Subclass

android.graphics.drawable.LayerDrawable has subclasses.
Click this link to see all its subclasses.

Constructor

LayerDrawable(@NonNull Drawable[] layers)
Creates a new layer drawable with the list of specified layers.

Method

voiddraw(Canvas canvas)
DrawablefindDrawableByLayerId(int id)
Looks for a layer with the given ID and returns its Drawable .
DrawablegetDrawable(int index)
Returns the drawable for the layer at the specified index.
intgetId(int index)
Returns the ID of the specified layer.
intgetIntrinsicHeight()
intgetIntrinsicWidth()
intgetLayerGravity(int index)
intgetLayerHeight(int index)
intgetLayerInsetBottom(int index)
intgetLayerInsetEnd(int index)
intgetLayerInsetLeft(int index)
intgetLayerInsetRight(int index)
intgetLayerInsetStart(int index)
intgetLayerInsetTop(int index)
intgetLayerWidth(int index)
intgetNumberOfLayers()
Returns the number of layers contained within this layer drawable.
booleangetPadding(Rect padding)
Drawablemutate()
voidsetBounds(int left, int top, int right, int bottom)
Specify a bounding rectangle for the Drawable.
voidsetBounds(@NonNull Rect bounds)
Specify a bounding rectangle for the Drawable.
voidsetCallback(@Nullable Callback cb)
Bind a Callback object to this Drawable.
voidsetColorFilter(@ColorInt int color, @NonNull PorterDuff.Mode mode)
Specify a color and Porter-Duff mode to be the color filter for this drawable.
voidsetDither(boolean dither)
booleansetDrawableByLayerId(int id, Drawable drawable)
Replaces the Drawable for the layer with the given id.
voidsetId(int index, int id)
Sets the ID of a layer.
voidsetLayerGravity(int index, int gravity)
Sets the gravity used to position or stretch the specified layer within its container.
voidsetLayerHeight(int index, int h)
voidsetLayerInset(int index, int l, int t, int r, int b)
Specifies the insets in pixels for the drawable at the specified index.
voidsetLayerInsetBottom(int index, int b)
voidsetLayerInsetEnd(int index, int e)
voidsetLayerInsetLeft(int index, int l)
voidsetLayerInsetRight(int index, int r)
voidsetLayerInsetStart(int index, int s)
voidsetLayerInsetTop(int index, int t)
voidsetLayerWidth(int index, int w)