public abstract class CheckStateDrawable extends Drawable
Subclasses should implement onStateChange(int, boolean, boolean) if new color != current color call this }
Drawable.Callback, Drawable.ConstantState| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
mChecked |
protected boolean |
mEnabled |
protected boolean |
mInEditMode |
| 构造器和说明 |
|---|
CheckStateDrawable(ColorStateList tintStateList) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getAlpha() |
int |
getCheckedColor() |
int |
getColor() |
ColorStateList |
getColorStateList()
Get the Tint ColorStateList
|
int |
getUnCheckedColor() |
void |
inEditMode(boolean inEditMode) |
boolean |
isChecked() |
boolean |
isEnabled() |
boolean |
isStateful() |
protected int |
modulateColorAlpha(int color) |
protected boolean |
onStateChange(int[] state)
Update tint color
|
protected abstract void |
onStateChange(int color,
boolean oldChecked,
boolean newChecked) |
void |
setAlpha(int alpha)
Set the alpha level for this drawable [0..255].
|
void |
setColor(int color)
Set color trans to ColorStateList
|
void |
setColorStateList(ColorStateList tintStateList)
Set the Tint ColorStateList
|
boolean |
setState(int[] stateSet) |
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, draw, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpacity, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setTint, setTintList, setTintMode, setVisible, unscheduleSelfprotected boolean mChecked
protected boolean mEnabled
protected boolean mInEditMode
public CheckStateDrawable(ColorStateList tintStateList)
public void inEditMode(boolean inEditMode)
public boolean isStateful()
isStateful 在类中 Drawableprotected boolean onStateChange(int[] state)
onStateChange 在类中 Drawablestate - tint statspublic void setAlpha(int alpha)
public void setColor(int color)
color - Colorpublic void setColorStateList(ColorStateList tintStateList)
tintStateList - ColorStateListpublic ColorStateList getColorStateList()
public int getColor()
public int getCheckedColor()
public int getUnCheckedColor()
protected int modulateColorAlpha(int color)
public boolean isChecked()
public boolean isEnabled()
protected abstract void onStateChange(int color,
boolean oldChecked,
boolean newChecked)