Example usage for Java android.graphics.drawable Drawable fields, constructors, methods, implement or subclass
The text is from its open source code.
void | clearColorFilter() Removes the color filter for this drawable. |
void | copyBounds(@NonNull Rect bounds) Return a copy of the drawable's bounds in the specified Rect (allocated by the caller). |
Rect | copyBounds() Return a copy of the drawable's bounds in a new Rect. |
Drawable | createFromPath(String pathName) Create a drawable from file path name. |
Drawable | createFromResourceStream(@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. |
Drawable | createFromStream(InputStream is, String srcName) Create a drawable from an inputstream |
Drawable | createFromXmlInner(@NonNull Resources r, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs) Create from inside an XML document. |
void | draw(@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). |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
int | getAlpha() Gets the current alpha value for the drawable. |
Rect | getBounds() Return the drawable's bounds Rect. |
Callback | getCallback() Return the current Callback implementation attached to this Drawable. |
int | getChangingConfigurations() Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. |
Class> | getClass() Returns the runtime class of this Object . |
ColorFilter | getColorFilter() Returns the current color filter, or null if none set. |
ConstantState | getConstantState() Return a ConstantState instance that holds the shared state of this Drawable. |
Drawable | getCurrent() |
int | getIntrinsicHeight() Returns the drawable's intrinsic height. |
int | getIntrinsicWidth() Returns the drawable's intrinsic width. |
int | getLevel() Retrieve the current level. |
int | getMinimumHeight() Returns the minimum height suggested by this Drawable. |
int | getMinimumWidth() Returns the minimum width suggested by this Drawable. |
int | getOpacity() Return the opacity/transparency of this Drawable. |
boolean | getPadding(@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. |
int | hashCode() Returns a hash code value for the object. |
void | invalidateSelf() Use the current Callback implementation to have this Drawable redrawn. |
boolean | isStateful() Indicates whether this drawable will change its appearance based on state. |
boolean | isVisible() |
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. |
void | setAlpha(@IntRange(from = 0, to = 255) int alpha) Specify an alpha value for the drawable. |
void | setBounds(int left, int top, int right, int bottom) Specify a bounding rectangle for the Drawable. |
void | setBounds(@NonNull Rect bounds) Specify a bounding rectangle for the Drawable. |
void | setCallback(@Nullable Callback cb) Bind a Callback object to this Drawable. |
void | setChangingConfigurations(@Config int configs) Set a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. |
void | setColorFilter(@ColorInt int color, @NonNull PorterDuff.Mode mode) Specify a color and Porter-Duff mode to be the color filter for this drawable. |
void | setColorFilter(@Nullable 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 | setFilterBitmap(boolean filter) Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated. |
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. |
boolean | setLevel(@IntRange(from = 0, to = 10000) int level) Specify the level for the drawable. |
boolean | setState(@NonNull final int[] stateSet) Specify a set of states for the drawable. |
void | setTint(@ColorInt int tintColor) Specifies tint color for this drawable. |
void | setTintList(@Nullable ColorStateList tint) Specifies tint color for this drawable as a color state list. |
void | setTintMode(@NonNull PorterDuff.Mode tintMode) Specifies a tint blending mode for this drawable. |
boolean | setVisible(boolean visible, boolean restart) Set whether this Drawable is visible. |
String | toString() Returns a string representation of the object. |