BitmapDrawable
open class BitmapDrawable : Drawable
| kotlin.Any | ||
| ↳ | android.graphics.drawable.Drawable | |
| ↳ | android.graphics.drawable.BitmapDrawable | |
A Drawable that wraps a bitmap and can be tiled, stretched, or aligned. You can create a BitmapDrawable from a file path, an input stream, through XML inflation, or from a android.graphics.Bitmap object.
It can be defined in an XML file with the <bitmap> element. For more information, see the guide to Drawable Resources.
Also see the android.graphics.Bitmap class, which handles the management and transformation of raw bitmap graphics, and should be used when drawing to a android.graphics.Canvas.
Summary
| XML attributes | |
|---|---|
android:antialias |
Enables or disables antialiasing. |
android:dither |
Enables or disables dithering of the bitmap if the bitmap does not have the same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with an RGB 565 screen). |
android:filter |
Enables or disables bitmap filtering. |
android:gravity |
Defines the gravity for the bitmap. |
android:mipMap |
Enables or disables the mipmap hint. |
android:src |
Identifier of the bitmap file. |
android:tileMode |
Defines the tile mode. |
| Public constructors | |
|---|---|
|
Create an empty drawable, not dealing with density. |
|
BitmapDrawable(res: Resources!)Create an empty drawable, setting initial target density based on the display metrics of the resources. |
|
BitmapDrawable(res: Resources!, bitmap: Bitmap!)Create drawable from a bitmap, setting initial target density based on the display metrics of the resources. |
|
BitmapDrawable(res: Resources!, is: InputStream!)Create a drawable by decoding a bitmap from the given input stream. |
|
BitmapDrawable(res: Resources!, filepath: String!)Create a drawable by opening a given file path and decoding the bitmap. |
|
BitmapDrawable(bitmap: Bitmap!)Create drawable from a bitmap, not dealing with density. |
|
BitmapDrawable(is: InputStream!)Create a drawable by decoding a bitmap from the given input stream. |
|
BitmapDrawable(filepath: String!)Create a drawable by opening a given file path and decoding the bitmap. |
|
| Public methods | |
|---|---|
| open Unit |
Applies the specified theme to this Drawable and its children. |
| open Boolean | |
| open Unit |
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter). |
| open Int |
getAlpha()Gets the current alpha value for the drawable. |
| Bitmap! |
Returns the bitmap used by this drawable to render. |
| open Int |
Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. |
| open ColorFilter? |
Returns the current color filter, or |
| Drawable.ConstantState? |
Return a |
| open Int |
Get the gravity used to position/stretch the bitmap within its bounds. |
| open Int |
Returns the drawable's intrinsic height. |
| open Int |
Returns the drawable's intrinsic width. |
| open Int |
Return the opacity/transparency of this Drawable. |
| open Insets |
Return in insets the layout insets suggested by this Drawable for use with alignment operations during layout. |
| open Unit |
getOutline(outline: Outline)Called to get the drawable to populate the Outline that defines its drawing area. |
| Paint! |
getPaint()Returns the paint used to render this drawable. |
| open Shader.TileMode! |
Indicates the repeat behavior of this drawable on the X axis. |
| open Shader.TileMode! |
Indicates the repeat behavior of this drawable on the Y axis. |
| open Boolean |
Indicates whether anti-aliasing is enabled for this drawable. |
| open Boolean |
Indicates whether this drawable has at least one state spec explicitly specifying |
| open Boolean |
Indicates whether the mipmap hint is enabled on this drawable's bitmap. |
| open Unit |
inflate(r: Resources, parser: XmlPullParser, attrs: AttributeSet, theme: Resources.Theme?)Inflate this Drawable from an XML resource optionally styled by a theme. |
| Boolean |
Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left. |
| open Boolean | |
| open Boolean |
Indicates whether this drawable will change its appearance based on state. |
| open Drawable |
mutate()A mutable BitmapDrawable still shares its Bitmap with any other Drawable that comes from the same resource. |
| open Unit |
Specify an alpha value for the drawable. |
| open Unit |
setAntiAlias(aa: Boolean)Enables or disables anti-aliasing for this drawable. |
| open Unit |
setAutoMirrored(mirrored: Boolean)Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left). |
| open Unit |
Switch to a new Bitmap object. |
| open Unit |
setColorFilter(colorFilter: ColorFilter?)Specify an optional color filter for the drawable. |
| open Unit |
Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component. |
| open Unit |
setFilterBitmap(filter: Boolean)Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated. |
| open Unit |
setGravity(gravity: Int)Set the gravity used to position/stretch the bitmap within its bounds. |
| open Unit |
Enables or disables the mipmap hint for this drawable's bitmap. |
| open Unit |
setTargetDensity(canvas: Canvas!)Set the density scale at which this drawable will be rendered. |
| open Unit |
setTargetDensity(metrics: DisplayMetrics!)Set the density scale at which this drawable will be rendered. |
| open Unit |
setTargetDensity(density: Int)Set the density at which this drawable will be rendered. |
| open Unit |
setTileModeX(mode: Shader.TileMode!)Sets the repeat behavior of this drawable on the X axis. |
| open Unit |
setTileModeXY(xmode: Shader.TileMode!, ymode: Shader.TileMode!)Sets the repeat behavior of this drawable on both axis. |
| Unit |
setTileModeY(mode: Shader.TileMode!)Sets the repeat behavior of this drawable on the Y axis. |
| open Unit |
setTintBlendMode(blendMode: BlendMode!)Specifies a tint blending mode for this drawable. |
| open Unit |
setTintList(tint: ColorStateList?)Specifies tint color for this drawable as a color state list. |
| Protected methods | |
|---|---|
| open Unit |
onBoundsChange(bounds: Rect)Override this in your subclass to change appearance if you vary based on the bounds. |
| open Boolean |
onStateChange(stateSet: IntArray)Override this in your subclass to change appearance if you recognize the specified state. |
| Inherited functions | |
|---|---|
XML attributes
android:antialias
android:antialiasMay be a boolean value, such as "true" or "false".
android:dither
android:ditherMay be a boolean value, such as "true" or "false".
android:filter
android:filterMay be a boolean value, such as "true" or "false".
android:gravity
android:gravityMust be one or more (separated by '|') of the following constant values.
| Constant | Value | Description |
|---|---|---|
| bottom | 50 | Push object to the bottom of its container, not changing its size. |
| center | 11 | Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. |
| center_horizontal | 1 | Place object in the horizontal center of its container, not changing its size. |
| center_vertical | 10 | Place object in the vertical center of its container, not changing its size. |
| clip_horizontal | 8 | Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges. |
| clip_vertical | 80 | Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges. |
| end | 800005 | Push object to the end of its container, not changing its size. |
| fill | 77 | Grow the horizontal and vertical size of the object if needed so it completely fills its container. |
| fill_horizontal | 7 | Grow the horizontal size of the object if needed so it completely fills its container. |
| fill_vertical | 70 | Grow the vertical size of the object if needed so it completely fills its container. |
| left | 3 | Push object to the left of its container, not changing its size. |
| right | 5 | Push object to the right of its container, not changing its size. |
| start | 800003 | Push object to the beginning of its container, not changing its size. |
| top | 30 | Push object to the top of its container, not changing its size. |
android:mipMap
android:mipMapandroid.graphics.Bitmap#setHasMipMap(boolean) for more information. Default value is false.
May be a boolean value, such as "true" or "false".
android:src
android:srcMay be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".
May be a color value, in the form of "rgb", "argb", "rrggbb", or "aarrggbb".
android:tileMode
android:tileModeMust be one of the following constant values.
| Constant | Value | Description |
|---|---|---|
| clamp | 0 | Replicates the edge color. |
| disabled | ffffffff | Do not tile the bitmap. This is the default value. |
| mirror | 2 | Repeats the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam. |
| repeat | 1 | Repeats the bitmap in both direction. |
Public constructors
BitmapDrawable
BitmapDrawable()
Deprecated: Use BitmapDrawable(android.content.res.Resources,android.graphics.Bitmap) instead to specify a bitmap to draw with and ensure the correct density is set.
Create an empty drawable, not dealing with density.
BitmapDrawable
BitmapDrawable(res: Resources!)
Deprecated: Use BitmapDrawable(android.content.res.Resources,android.graphics.Bitmap) instead to specify a bitmap to draw with.
Create an empty drawable, setting initial target density based on the display metrics of the resources.
BitmapDrawable
BitmapDrawable(
res: Resources!,
bitmap: Bitmap!)
Create drawable from a bitmap, setting initial target density based on the display metrics of the resources.
BitmapDrawable
BitmapDrawable(
res: Resources!,
is: InputStream!)
Create a drawable by decoding a bitmap from the given input stream.
BitmapDrawable
BitmapDrawable(
res: Resources!,
filepath: String!)
Create a drawable by opening a given file path and decoding the bitmap.
BitmapDrawable
BitmapDrawable(bitmap: Bitmap!)
Deprecated: Use BitmapDrawable(android.content.res.Resources,android.graphics.Bitmap) to ensure that the drawable has correctly set its target density.
Create drawable from a bitmap, not dealing with density.
BitmapDrawable
BitmapDrawable(is: InputStream!)
Deprecated: Use BitmapDrawable(android.content.res.Resources,java.io.InputStream) to ensure that the drawable has correctly set its target density.
Create a drawable by decoding a bitmap from the given input stream.
BitmapDrawable
BitmapDrawable(filepath: String!)
Deprecated: Use BitmapDrawable(android.content.res.Resources,java.lang.String) to ensure that the drawable has correctly set its target density.
Create a drawable by opening a given file path and decoding the bitmap.
Public methods
applyTheme
open fun applyTheme(t: Resources.Theme): Unit
Applies the specified theme to this Drawable and its children.
| Parameters | |
|---|---|
t |
Resources.Theme: the theme to apply. This value cannot be null. |
draw
open fun draw(canvas: Canvas): Unit
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
| Parameters | |
|---|---|
canvas |
Canvas: The canvas to draw into. This value cannot be null. |
getAlpha
open fun getAlpha(): Int
Gets the current alpha value for the drawable. 0 means fully transparent, 255 means fully opaque. This method is implemented by Drawable subclasses and the value returned is specific to how that class treats alpha. The default return value is 255 if the class does not override this method to return a value specific to its use of alpha.
| Return | |
|---|---|
Int |
Value is between 0 and 255 inclusive |
getBitmap
fun getBitmap(): Bitmap!
Returns the bitmap used by this drawable to render. May be null.
getChangingConfigurations
open fun getChangingConfigurations(): Int
Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. The default implementation returns whatever was provided through setChangingConfigurations(int) or 0 by default. Subclasses may extend this to or in the changing configurations of any other drawables they hold.
getColorFilter
open fun getColorFilter(): ColorFilter?
Returns the current color filter, or null if none set.
| Return | |
|---|---|
ColorFilter? |
the current color filter, or null if none set |
getConstantState
fun getConstantState(): Drawable.ConstantState?
Return a ConstantState instance that holds the shared state of this Drawable.
| Return | |
|---|---|
Drawable.ConstantState? |
The ConstantState associated to that Drawable. This value may be null. |
getGravity
open fun getGravity(): Int
Get the gravity used to position/stretch the bitmap within its bounds. See android.view.Gravity
| Return | |
|---|---|
Int |
the gravity applied to the bitmap |
getIntrinsicHeight
open fun getIntrinsicHeight(): Int
Returns the drawable's intrinsic height.
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.
| Return | |
|---|---|
Int |
the intrinsic height, or -1 if no intrinsic height |
getIntrinsicWidth
open fun getIntrinsicWidth(): Int
Returns the drawable's intrinsic width.
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.
| Return | |
|---|---|
Int |
the intrinsic width, or -1 if no intrinsic width |
getOpacity
open fun getOpacity(): Int
Return the opacity/transparency of this Drawable. The returned value is one of the abstract format constants in android.graphics.PixelFormat: android.graphics.PixelFormat#UNKNOWN, android.graphics.PixelFormat#TRANSLUCENT, android.graphics.PixelFormat#TRANSPARENT, or android.graphics.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 resolveOpacity 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 setAlpha or #setColorFilter methods. Some subclasses, such as BitmapDrawable, ColorDrawable, and GradientDrawable, do account for the value of setAlpha, but the general behavior is dependent upon the implementation of the subclass.
| Return | |
|---|---|
Int |
int The opacity class of the Drawable. Value is one of the following: |
getOpticalInsets
open fun getOpticalInsets(): Insets
Return in insets the layout insets suggested by this Drawable for use with alignment operations during layout.
| Return | |
|---|---|
Insets |
This value cannot be null. |
getOutline
open fun getOutline(outline: Outline): Unit
Called to get the drawable to populate the Outline that defines its drawing area.
This method is called by the default android.view.ViewOutlineProvider to define the outline of the View.
The default behavior defines the outline to be the bounding rectangle of 0 alpha. Subclasses that wish to convey a different shape or alpha value must override this method.
| Parameters | |
|---|---|
outline |
Outline: This value cannot be null. |
getPaint
fun getPaint(): Paint!
Returns the paint used to render this drawable.
getTileModeX
open fun getTileModeX(): Shader.TileMode!
Indicates the repeat behavior of this drawable on the X axis.
| Return | |
|---|---|
Shader.TileMode! |
android.graphics.Shader.TileMode#CLAMP if the bitmap does not repeat, android.graphics.Shader.TileMode#REPEAT or android.graphics.Shader.TileMode#MIRROR otherwise. |
getTileModeY
open fun getTileModeY(): Shader.TileMode!
Indicates the repeat behavior of this drawable on the Y axis.
| Return | |
|---|---|
Shader.TileMode! |
android.graphics.Shader.TileMode#CLAMP if the bitmap does not repeat, android.graphics.Shader.TileMode#REPEAT or android.graphics.Shader.TileMode#MIRROR otherwise. |
hasAntiAlias
open fun hasAntiAlias(): Boolean
Indicates whether anti-aliasing is enabled for this drawable.
| Return | |
|---|---|
Boolean |
True if anti-aliasing is enabled, false otherwise. |
See Also
hasFocusStateSpecified
open fun hasFocusStateSpecified(): Boolean
Indicates whether this drawable has at least one state spec explicitly specifying android.R.attr#state_focused.
Note: A View uses a Drawable instance as its background and it changes its appearance based on a state. On keyboard devices, it should specify its android.R.attr#state_focused to make sure the user knows which view is holding the focus.
| Return | |
|---|---|
Boolean |
true if android.R.attr#state_focused is specified for this drawable. |
hasMipMap
open fun hasMipMap(): Boolean
Indicates whether the mipmap hint is enabled on this drawable's bitmap.
| Return | |
|---|---|
Boolean |
True if the mipmap hint is set, false otherwise. If the bitmap is null, this method always returns false. |
See Also
inflate
open fun inflate(
r: Resources,
parser: XmlPullParser,
attrs: AttributeSet,
theme: Resources.Theme?
): Unit
Inflate this Drawable from an XML resource optionally styled by a theme. This can't be called more than once for each Drawable. Note that framework may have called this once to create the Drawable instance from XML resource.
| Parameters | |
|---|---|
r |
Resources: Resources used to resolve attribute values. This value cannot be null. |
parser |
XmlPullParser: XML parser from which to inflate this Drawable. This value cannot be null. |
attrs |
AttributeSet: Base set of attribute values. This value cannot be null. |
theme |
Resources.Theme?: Theme to apply, may be null |
| Exceptions | |
|---|---|
java.io.IOException |
|
org.xmlpull.v1.XmlPullParserException |
|
isAutoMirrored
fun isAutoMirrored(): Boolean
Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left. See android.util.LayoutDirection.
| Return | |
|---|---|
Boolean |
boolean Returns true if this Drawable will be automatically mirrored. |
isFilterBitmap
open fun isFilterBitmap(): Boolean
| Return | |
|---|---|
Boolean |
whether this drawable filters its bitmaps |
isStateful
open fun isStateful(): Boolean
Indicates whether this drawable will change its appearance based on state. Clients can use this to determine whether it is necessary to calculate their state and call setState.
| Return | |
|---|---|
Boolean |
True if this drawable changes its appearance based on state, false otherwise. |
mutate
open fun mutate(): Drawable
A mutable BitmapDrawable still shares its Bitmap with any other Drawable that comes from the same resource.
| Return | |
|---|---|
Drawable |
This drawable. |
setAlpha
open fun setAlpha(alpha: Int): Unit
Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.
| Parameters | |
|---|---|
alpha |
Int: Value is between 0 and 255 inclusive |
setAntiAlias
open fun setAntiAlias(aa: Boolean): Unit
Enables or disables anti-aliasing for this drawable. Anti-aliasing affects the edges of the bitmap only so it applies only when the drawable is rotated.
| Parameters | |
|---|---|
aa |
Boolean: True if the bitmap should be anti-aliased, false otherwise. |
See Also
setAutoMirrored
open fun setAutoMirrored(mirrored: Boolean): Unit
Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left). See android.util.LayoutDirection.
| Parameters | |
|---|---|
mirrored |
Boolean: Set to true if the Drawable should be mirrored, false if not. |
setBitmap
open fun setBitmap(bitmap: Bitmap?): Unit
Switch to a new Bitmap object.
| Parameters | |
|---|---|
bitmap |
Bitmap?: This value may be null. |
setColorFilter
open fun setColorFilter(colorFilter: ColorFilter?): Unit
Specify an optional color filter for the 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.
| Parameters | |
|---|---|
colorFilter |
ColorFilter?: The color filter to apply, or null to remove the existing color filter |
setDither
open fun setDither(dither: Boolean): Unit
Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component.
setFilterBitmap
open fun setFilterBitmap(filter: Boolean): Unit
Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated.
This can improve appearance when bitmaps are rotated. If the drawable does not use bitmaps, this call is ignored.
setGravity
open fun setGravity(gravity: Int): Unit
Set the gravity used to position/stretch the bitmap within its bounds. See android.view.Gravity
| Parameters | |
|---|---|
gravity |
Int: the gravity |
setMipMap
open fun setMipMap(mipMap: Boolean): Unit
Enables or disables the mipmap hint for this drawable's bitmap. See Bitmap.setHasMipMap(boolean) for more information. If the bitmap is null calling this method has no effect.
| Parameters | |
|---|---|
mipMap |
Boolean: True if the bitmap should use mipmaps, false otherwise. |
See Also
setTargetDensity
open fun setTargetDensity(canvas: Canvas!): Unit
Set the density scale at which this drawable will be rendered. This method assumes the drawable will be rendered at the same density as the specified canvas.
| Parameters | |
|---|---|
canvas |
Canvas!: The Canvas from which the density scale must be obtained. |
setTargetDensity
open fun setTargetDensity(metrics: DisplayMetrics!): Unit
Set the density scale at which this drawable will be rendered.
| Parameters | |
|---|---|
metrics |
DisplayMetrics!: The DisplayMetrics indicating the density scale for this drawable. |
setTargetDensity
open fun setTargetDensity(density: Int): Unit
Set the density at which this drawable will be rendered.
| Parameters | |
|---|---|
density |
Int: The density scale for this drawable. |
setTileModeX
open fun setTileModeX(mode: Shader.TileMode!): Unit
Sets the repeat behavior of this drawable on the X axis. By default, the drawable does not repeat its bitmap. Using android.graphics.Shader.TileMode#REPEAT or android.graphics.Shader.TileMode#MIRROR the bitmap can be repeated (or tiled) if the bitmap is smaller than this drawable.
| Parameters | |
|---|---|
mode |
Shader.TileMode!: The repeat mode for this drawable. |
setTileModeXY
open fun setTileModeXY(
xmode: Shader.TileMode!,
ymode: Shader.TileMode!
): Unit
Sets the repeat behavior of this drawable on both axis. By default, the drawable does not repeat its bitmap. Using android.graphics.Shader.TileMode#REPEAT or android.graphics.Shader.TileMode#MIRROR the bitmap can be repeated (or tiled) if the bitmap is smaller than this drawable.
| Parameters | |
|---|---|
xmode |
Shader.TileMode!: The X repeat mode for this drawable. |
ymode |
Shader.TileMode!: The Y repeat mode for this drawable. |
setTileModeY
fun setTileModeY(mode: Shader.TileMode!): Unit
Sets the repeat behavior of this drawable on the Y axis. By default, the drawable does not repeat its bitmap. Using android.graphics.Shader.TileMode#REPEAT or android.graphics.Shader.TileMode#MIRROR the bitmap can be repeated (or tiled) if the bitmap is smaller than this drawable.
| Parameters | |
|---|---|
mode |
Shader.TileMode!: The repeat mode for this drawable. |
setTintBlendMode
open fun setTintBlendMode(blendMode: BlendMode!): Unit
Specifies a tint blending mode for this drawable.
Defines how this drawable's tint color should be blended into the drawable before it is drawn to screen. Default tint mode is BlendMode.SRC_IN.
Note: Setting a color filter via setColorFilter(android.graphics.ColorFilter)
| Parameters | |
|---|---|
blendMode |
BlendMode!: This value cannot be null. |
setTintList
open fun setTintList(tint: ColorStateList?): Unit
Specifies tint color for this drawable as a color state list.
A Drawable's drawing content will be blended together with its tint before it is drawn to the screen. This functions similarly to setColorFilter(int,android.graphics.PorterDuff.Mode).
Note: Setting a color filter via setColorFilter(android.graphics.ColorFilter) or setColorFilter(int,android.graphics.PorterDuff.Mode) overrides tint.
| Parameters | |
|---|---|
tint |
ColorStateList?: Color state list to use for tinting this drawable, or null to clear the tint |
Protected methods
onBoundsChange
protected open fun onBoundsChange(bounds: Rect): Unit
Override this in your subclass to change appearance if you vary based on the bounds.
| Parameters | |
|---|---|
bounds |
Rect: This value cannot be null. |
onStateChange
protected open fun onStateChange(stateSet: IntArray): Boolean
Override this in your subclass to change appearance if you recognize the specified state.
| Parameters | |
|---|---|
state |
This value cannot be null. |
| Return | |
|---|---|
Boolean |
Returns true if the state change has caused the appearance of the Drawable to change (that is, it needs to be drawn), else false if it looks the same and there is no need to redraw it since its last state. |