public class ThreeStateDrawable
extends android.graphics.drawable.Drawable
Modifier and Type | Field and Description |
---|---|
protected int |
_alpha |
protected android.graphics.ColorFilter |
_colorFilter |
protected android.graphics.drawable.Drawable |
_offIcon |
protected android.graphics.drawable.Drawable |
_onIcon |
protected android.graphics.drawable.Drawable |
_semiIcon |
protected int |
_state |
static int |
OFF |
static int |
ON |
static int |
SEMI |
Constructor and Description |
---|
ThreeStateDrawable(android.content.Context context,
int onIconId,
int semiIconId,
int offIconId) |
ThreeStateDrawable(android.graphics.drawable.Drawable onIcon,
android.graphics.drawable.Drawable semiIcon,
android.graphics.drawable.Drawable offIcon) |
Modifier and Type | Method and Description |
---|---|
void |
draw(android.graphics.Canvas canvas) |
int |
getCurrentState()
Get the current state of the drawable
|
int |
getOpacity() |
protected void |
onBoundsChange(android.graphics.Rect bounds) |
void |
setAlpha(int alpha) |
void |
setColorFilter(android.graphics.ColorFilter colorFilter) |
void |
setCurrentState(int state)
Set the state of the drawable
|
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode, setVisible, unscheduleSelf
public static final int ON
public static final int SEMI
public static final int OFF
protected final android.graphics.drawable.Drawable _onIcon
protected final android.graphics.drawable.Drawable _semiIcon
protected final android.graphics.drawable.Drawable _offIcon
protected int _state
protected int _alpha
protected android.graphics.ColorFilter _colorFilter
public ThreeStateDrawable(android.graphics.drawable.Drawable onIcon, android.graphics.drawable.Drawable semiIcon, android.graphics.drawable.Drawable offIcon)
public ThreeStateDrawable(android.content.Context context, int onIconId, int semiIconId, int offIconId)
public void setCurrentState(int state)
public int getCurrentState()
public void draw(android.graphics.Canvas canvas)
draw
in class android.graphics.drawable.Drawable
public void setAlpha(int alpha)
setAlpha
in class android.graphics.drawable.Drawable
public void setColorFilter(android.graphics.ColorFilter colorFilter)
setColorFilter
in class android.graphics.drawable.Drawable
public int getOpacity()
getOpacity
in class android.graphics.drawable.Drawable
protected void onBoundsChange(android.graphics.Rect bounds)
onBoundsChange
in class android.graphics.drawable.Drawable