public class NavButtonDrawable
extends android.graphics.drawable.Drawable
implements android.graphics.drawable.Drawable.Callback
NavButton
and other nav-related icons
Supports dynamic shadow below the iconConstructor and Description |
---|
NavButtonDrawable(android.content.Context appContext,
android.graphics.drawable.Drawable baseDrawable) |
NavButtonDrawable(android.content.Context appContext,
int baseDrawableId) |
NavButtonDrawable(android.widget.ImageView view) |
Modifier and Type | Method and Description |
---|---|
void |
draw(android.graphics.Canvas canvas) |
android.graphics.drawable.Drawable |
getBaseDrawable()
Get the base drawable
|
android.graphics.drawable.Drawable.ConstantState |
getConstantState() |
int |
getIntrinsicHeight() |
int |
getIntrinsicWidth() |
int |
getOpacity() |
void |
invalidateDrawable(android.graphics.drawable.Drawable who) |
void |
scheduleDrawable(android.graphics.drawable.Drawable who,
java.lang.Runnable what,
long when) |
void |
setAlpha(int alpha) |
void |
setBadgeCount(int count)
Set the count to display in the top-right badge
|
void |
setBadgeImage(android.graphics.drawable.Drawable image)
Set an image drawable to display in the bottom-right
|
void |
setBounds(int left,
int top,
int right,
int bottom) |
void |
setColor(int color)
Set the primary color of this drawable
|
void |
setColorFilter(android.graphics.ColorFilter colorFilter) |
void |
setShadowColor(int color)
Set the shadow color
|
void |
setShadowColorFilter(android.graphics.ColorFilter filter)
Set the color filter for the button shadow
|
void |
setShadowPadding(boolean padding)
Set whether automatic shaddow padding is enabled
|
void |
setShadowRadius(float radius)
Set the radius of the shadow
|
void |
unscheduleDrawable(android.graphics.drawable.Drawable who,
java.lang.Runnable what) |
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode, setVisible, unscheduleSelf
public NavButtonDrawable(android.content.Context appContext, android.graphics.drawable.Drawable baseDrawable)
public NavButtonDrawable(android.content.Context appContext, int baseDrawableId)
public NavButtonDrawable(android.widget.ImageView view)
public android.graphics.drawable.Drawable getBaseDrawable()
public void setColor(int color)
color
- Color integerpublic void setShadowRadius(float radius)
radius
- Radius in pixels or zero to remove shadowpublic void setShadowColorFilter(android.graphics.ColorFilter filter)
filter
- Color filterpublic void setShadowColor(int color)
color
- Color integerpublic void setShadowPadding(boolean padding)
padding
- True if enabledpublic void setBadgeCount(int count)
count
- Count (zero to hide badge)public void setBadgeImage(android.graphics.drawable.Drawable image)
image
- Image drawablepublic 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
public void setBounds(int left, int top, int right, int bottom)
setBounds
in class android.graphics.drawable.Drawable
public int getIntrinsicWidth()
getIntrinsicWidth
in class android.graphics.drawable.Drawable
public int getIntrinsicHeight()
getIntrinsicHeight
in class android.graphics.drawable.Drawable
public android.graphics.drawable.Drawable.ConstantState getConstantState()
getConstantState
in class android.graphics.drawable.Drawable
public void invalidateDrawable(android.graphics.drawable.Drawable who)
invalidateDrawable
in interface android.graphics.drawable.Drawable.Callback
public void scheduleDrawable(android.graphics.drawable.Drawable who, java.lang.Runnable what, long when)
scheduleDrawable
in interface android.graphics.drawable.Drawable.Callback
public void unscheduleDrawable(android.graphics.drawable.Drawable who, java.lang.Runnable what)
unscheduleDrawable
in interface android.graphics.drawable.Drawable.Callback