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

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

Introduction

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

The text is from its open source code.

Subclass

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

Constructor

Method

voidclearColorFilter()
Removes the color filter for this drawable.
voidcopyBounds(@NonNull Rect bounds)
Return a copy of the drawable's bounds in the specified Rect (allocated by the caller).
RectcopyBounds()
Return a copy of the drawable's bounds in a new Rect.
DrawablecreateFromPath(String pathName)
Create a drawable from file path name.
DrawablecreateFromResourceStream(@Nullable Resources res, @Nullable TypedValue value, @Nullable InputStream is, @Nullable String srcName, @Nullable BitmapFactory.Options opts)
Create a drawable from an inputstream, using the given resources and value to determine density information.
DrawablecreateFromStream(InputStream is, String srcName)
Create a drawable from an inputstream
DrawablecreateFromXmlInner(@NonNull Resources r, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs)
Create from inside an XML document.
voiddraw(@NonNull Canvas canvas)
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
intgetAlpha()
Gets the current alpha value for the drawable.
RectgetBounds()
Return the drawable's bounds Rect.
CallbackgetCallback()
Return the current Callback implementation attached to this Drawable.
intgetChangingConfigurations()
Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created.
ClassgetClass()
Returns the runtime class of this Object .
ColorFiltergetColorFilter()
Returns the current color filter, or null if none set.
ConstantStategetConstantState()
Return a ConstantState instance that holds the shared state of this Drawable.
DrawablegetCurrent()
intgetIntrinsicHeight()
Returns the drawable's intrinsic height.
intgetIntrinsicWidth()
Returns the drawable's intrinsic width.
intgetLevel()
Retrieve the current level.
intgetMinimumHeight()
Returns the minimum height suggested by this Drawable.
intgetMinimumWidth()
Returns the minimum width suggested by this Drawable.
intgetOpacity()
Return the opacity/transparency of this Drawable.
booleangetPadding(@NonNull Rect padding)
Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds.
int[]getState()
Describes the current state, as a union of primitve states, such as android.R.attr#state_focused , android.R.attr#state_selected , etc.
inthashCode()
Returns a hash code value for the object.
voidinvalidateSelf()
Use the current Callback implementation to have this Drawable redrawn.
booleanisStateful()
Indicates whether this drawable will change its appearance based on state.
booleanisVisible()
voidjumpToCurrentState()
If this Drawable does transition animations between states, ask that it immediately jump to the current state and skip any active animations.
Drawablemutate()
Make this drawable mutable.
voidsetAlpha(@IntRange(from = 0, to = 255) int alpha)
Specify an alpha value for the drawable.
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.
voidsetChangingConfigurations(@Config int configs)
Set a mask of the configuration parameters for which this drawable may change, requiring that it be re-created.
voidsetColorFilter(@ColorInt int color, @NonNull PorterDuff.Mode mode)
Specify a color and Porter-Duff mode to be the color filter for this drawable.
voidsetColorFilter(@Nullable ColorFilter colorFilter)
Specify an optional color filter for the drawable.
voidsetDither(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.
voidsetFilterBitmap(boolean filter)
Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated.
voidsetHotspot(float x, float y)
Specifies the hotspot's location within the drawable.
voidsetHotspotBounds(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.
booleansetLevel(@IntRange(from = 0, to = 10000) int level)
Specify the level for the drawable.
booleansetState(@NonNull final int[] stateSet)
Specify a set of states for the drawable.
voidsetTint(@ColorInt int tintColor)
Specifies tint color for this drawable.
voidsetTintList(@Nullable ColorStateList tint)
Specifies tint color for this drawable as a color state list.
voidsetTintMode(@NonNull PorterDuff.Mode tintMode)
Specifies a tint blending mode for this drawable.
booleansetVisible(boolean visible, boolean restart)
Set whether this Drawable is visible.
StringtoString()
Returns a string representation of the object.