public class MaterialMenuDrawable extends android.graphics.drawable.Drawable implements MaterialMenu, android.graphics.drawable.Animatable
| Modifier and Type | Class and Description |
|---|---|
static class |
MaterialMenuDrawable.AnimationState |
static class |
MaterialMenuDrawable.IconState |
static class |
MaterialMenuDrawable.Stroke |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_COLOR |
static int |
DEFAULT_SCALE |
static int |
DEFAULT_TRANSFORM_DURATION |
static boolean |
DEFAULT_VISIBLE |
| Constructor and Description |
|---|
MaterialMenuDrawable(android.content.Context context,
int color,
MaterialMenuDrawable.Stroke stroke) |
MaterialMenuDrawable(android.content.Context context,
int color,
MaterialMenuDrawable.Stroke stroke,
int transformDuration) |
MaterialMenuDrawable(android.content.Context context,
int color,
MaterialMenuDrawable.Stroke stroke,
int scale,
int transformDuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
animateIconState(MaterialMenuDrawable.IconState state)
Animate icon to given state.
|
void |
draw(android.graphics.Canvas canvas) |
android.graphics.drawable.Drawable.ConstantState |
getConstantState() |
MaterialMenuDrawable.IconState |
getIconState()
Return current icon state
|
int |
getIntrinsicHeight() |
int |
getIntrinsicWidth() |
int |
getOpacity() |
java.lang.Float |
getTransformationValue() |
boolean |
isDrawableVisible() |
boolean |
isRunning() |
android.graphics.drawable.Drawable |
mutate() |
void |
setAlpha(int alpha) |
void |
setAnimationListener(android.animation.Animator.AnimatorListener listener)
Set listener for
MaterialMenuDrawable animation events |
void |
setColor(int color)
Set color of icon
|
void |
setColorFilter(android.graphics.ColorFilter cf) |
void |
setIconState(MaterialMenuDrawable.IconState iconState)
Change icon without animation
|
void |
setInterpolator(android.view.animation.Interpolator interpolator)
Set interpolator for transformation animations
|
void |
setRTLEnabled(boolean rtlEnabled)
Enable RTL layout.
|
void |
setTransformationDuration(int duration)
Set duration of transformation animations
|
MaterialMenuDrawable.IconState |
setTransformationOffset(MaterialMenuDrawable.AnimationState animationState,
float offset)
Manually set a transformation value for an
MaterialMenuDrawable.AnimationState |
void |
setTransformationValue(java.lang.Float value) |
void |
setVisible(boolean visible)
Set visibility of icon
|
void |
start() |
void |
stop() |
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, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isStateful, isVisible, jumpToCurrentState, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintList, setTintMode, setVisible, unscheduleSelfpublic static final int DEFAULT_COLOR
public static final int DEFAULT_SCALE
public static final int DEFAULT_TRANSFORM_DURATION
public static final boolean DEFAULT_VISIBLE
public MaterialMenuDrawable(android.content.Context context,
int color,
MaterialMenuDrawable.Stroke stroke)
public MaterialMenuDrawable(android.content.Context context,
int color,
MaterialMenuDrawable.Stroke stroke,
int transformDuration)
public MaterialMenuDrawable(android.content.Context context,
int color,
MaterialMenuDrawable.Stroke stroke,
int scale,
int transformDuration)
public void draw(android.graphics.Canvas canvas)
draw in class android.graphics.drawable.Drawablepublic void setAlpha(int alpha)
setAlpha in class android.graphics.drawable.Drawablepublic void setColorFilter(android.graphics.ColorFilter cf)
setColorFilter in class android.graphics.drawable.Drawablepublic int getOpacity()
getOpacity in class android.graphics.drawable.Drawablepublic void setColor(int color)
MaterialMenusetColor in interface MaterialMenucolor - new icon colorpublic void setTransformationDuration(int duration)
MaterialMenusetTransformationDuration in interface MaterialMenuduration - new animation durationpublic void setInterpolator(android.view.animation.Interpolator interpolator)
MaterialMenusetInterpolator in interface MaterialMenuinterpolator - new interpolatorpublic void setAnimationListener(android.animation.Animator.AnimatorListener listener)
MaterialMenuMaterialMenuDrawable animation eventssetAnimationListener in interface MaterialMenulistener - new listener or null to remove any listenerpublic void setIconState(MaterialMenuDrawable.IconState iconState)
MaterialMenusetIconState in interface MaterialMenuiconState - new icon statepublic void animateIconState(MaterialMenuDrawable.IconState state)
MaterialMenuanimateIconState in interface MaterialMenustate - new icon statepublic MaterialMenuDrawable.IconState setTransformationOffset(MaterialMenuDrawable.AnimationState animationState, float offset)
MaterialMenuMaterialMenuDrawable.AnimationStatesetTransformationOffset in interface MaterialMenuanimationState - state to set value inoffset - between TRANSFORMATION_START and
TRANSFORMATION_END.public void setVisible(boolean visible)
MaterialMenusetVisible in interface MaterialMenuvisible - new value for visibilitypublic void setRTLEnabled(boolean rtlEnabled)
MaterialMenusetRTLEnabled in interface MaterialMenurtlEnabled - true to enable RTL layoutpublic MaterialMenuDrawable.IconState getIconState()
MaterialMenugetIconState in interface MaterialMenupublic boolean isDrawableVisible()
public java.lang.Float getTransformationValue()
public void setTransformationValue(java.lang.Float value)
public void start()
start in interface android.graphics.drawable.Animatablepublic void stop()
stop in interface android.graphics.drawable.Animatablepublic boolean isRunning()
isRunning in interface android.graphics.drawable.Animatablepublic int getIntrinsicWidth()
getIntrinsicWidth in class android.graphics.drawable.Drawablepublic int getIntrinsicHeight()
getIntrinsicHeight in class android.graphics.drawable.Drawablepublic android.graphics.drawable.Drawable.ConstantState getConstantState()
getConstantState in class android.graphics.drawable.Drawablepublic android.graphics.drawable.Drawable mutate()
mutate in class android.graphics.drawable.Drawable