Package icyllis.modernui.material

# Class MaterialDrawable

java.lang.Object
icyllis.modernui.graphics.drawable.Drawable
icyllis.modernui.material.MaterialDrawable

Direct Known Subclasses:
  `SubMenuArrowDrawable`

public abstract class MaterialDrawable extends Drawable
Base drawable that used for blending with white vectors.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.modernui.graphics.drawable.Drawable

  `Drawable.Callback, Drawable.ConstantState`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `mAlpha`
  `protected int`
  `mColor`
  `protected ColorStateList`
  `mTint`

  ### Fields inherited from class icyllis.modernui.graphics.drawable.Drawable

  `MAX_LEVEL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MaterialDrawable()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAlpha()`
  Gets the current alpha value for the drawable.
  `boolean`
  `hasFocusStateSpecified()`
  Indicates whether this drawable has at least one state spec explicitly specifying state_focused.
  `boolean`
  `isStateful()`
  Indicates whether this drawable will change its appearance based on state.
  `protected boolean`
  `onStateChange(int[] stateSet)`
  Override this in your subclass to change appearance if you recognize the specified state.
  `void`
  `setAlpha(int alpha)`
  Specify an alpha value for the drawable.
  `void`
  `setTintList(ColorStateList tint)`
  Specifies tint color for this drawable as a color state list.

  ### Methods inherited from class icyllis.modernui.graphics.drawable.Drawable

  `applyTheme, canApplyTheme, clearMutated, copyBounds, copyBounds, draw, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getPadding, getState, invalidateSelf, isAutoMirrored, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, scaleFromDensity, scaleFromDensity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setVisible, unscheduleSelf`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mTint

    protected ColorStateList mTint

  - ### mColor

    protected int mColor

  - ### mAlpha

    protected int mAlpha

- ## Constructor Details

  - ### MaterialDrawable

    public MaterialDrawable()

- ## Method Details

  - ### setTintList

    public void setTintList(@Nullable ColorStateList tint)
    Description copied from class: `Drawable`
    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.

    Note: Setting a color filter via `Drawable.setColorFilter(ColorFilter)` overrides tint.

    Overrides:
      `setTintList` in class `Drawable`
    Parameters:
      `tint` - Color state list to use for tinting this drawable, or `null` to clear the tint
    See Also:
      - `Drawable.setTint(int)`
      - `Drawable.setTintBlendMode(BlendMode)`

  - ### onStateChange

    protected boolean onStateChange(@Nonnull int[] stateSet)
    Description copied from class: `Drawable`
    Override this in your subclass to change appearance if you recognize the specified state.
    Overrides:
      `onStateChange` in class `Drawable`
    Returns:
      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.

  - ### isStateful

    public boolean isStateful()
    Description copied from class: `Drawable`
    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.
    Overrides:
      `isStateful` in class `Drawable`
    Returns:
      True if this drawable changes its appearance based on state, false otherwise.
    See Also:
      - `Drawable.setState(int[])`

  - ### hasFocusStateSpecified

    public boolean hasFocusStateSpecified()
    Description copied from class: `Drawable`
    Indicates whether this drawable has at least one state spec explicitly specifying 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 state_focused to make sure the user knows which view is holding the focus.

    Overrides:
      `hasFocusStateSpecified` in class `Drawable`
    Returns:
      `true` if state_focused is specified for this drawable.

  - ### setAlpha

    public void setAlpha(int alpha)
    Description copied from class: `Drawable`
    Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.
    Overrides:
      `setAlpha` in class `Drawable`

  - ### getAlpha

    public int getAlpha()
    Description copied from class: `Drawable`
    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.
    Overrides:
      `getAlpha` in class `Drawable`