public abstract class MaterialMenuBase extends java.lang.Object implements MaterialMenu
MaterialMenuDrawable
MaterialMenuIcon
构造器和说明 |
---|
MaterialMenuBase(android.app.Activity activity,
int color,
MaterialMenuDrawable.Stroke stroke) |
MaterialMenuBase(android.app.Activity activity,
int color,
MaterialMenuDrawable.Stroke stroke,
int transformDuration) |
MaterialMenuBase(android.app.Activity activity,
int color,
MaterialMenuDrawable.Stroke stroke,
int transformDuration,
int pressedDuration) |
限定符和类型 | 方法和说明 |
---|---|
void |
animatePressedState(MaterialMenuDrawable.IconState state)
Animate icon to given state and draw touch circle
|
void |
animateState(MaterialMenuDrawable.IconState state)
Animate icon to given state.
|
protected abstract android.view.View |
getActionBarHomeView(android.app.Activity activity) |
protected abstract android.view.View |
getActionBarUpView(android.app.Activity activity) |
MaterialMenuDrawable |
getDrawable() |
MaterialMenuDrawable.IconState |
getState()
Return current icon state
|
void |
onSaveInstanceState(android.os.Bundle outState)
Call from
Activity.onSaveInstanceState(android.os.Bundle) to store current icon state |
protected abstract boolean |
providesActionBar() |
protected abstract void |
setActionBarSettings(android.app.Activity activity) |
void |
setColor(int color)
Set color of icon
|
void |
setInterpolator(android.view.animation.Interpolator interpolator)
Set interpolator for transformation animations
|
void |
setNeverDrawTouch(boolean neverDrawTouch)
Overwrites behaviour of pressed state circle animation even when using
animatePressedState(com.marshalchen.common.ui.materialmenu.MaterialMenuDrawable.IconState) |
void |
setPressedDuration(int duration)
Set duration of pressed state circle animation
|
void |
setRTLEnabled(boolean rtlEnabled)
Enable RTL layout.
|
void |
setState(MaterialMenuDrawable.IconState state)
Change icon without animation
|
void |
setTransformationDuration(int duration)
Set duration of transformation animations
|
void |
setTransformationOffset(MaterialMenuDrawable.AnimationState animationState,
float value)
Manually set a transformation value for an
MaterialMenuDrawable.AnimationState |
void |
syncState(android.os.Bundle state)
Call from
Activity.onPostCreate(android.os.Bundle) to restore icon state |
public MaterialMenuBase(android.app.Activity activity, int color, MaterialMenuDrawable.Stroke stroke)
public MaterialMenuBase(android.app.Activity activity, int color, MaterialMenuDrawable.Stroke stroke, int transformDuration)
public MaterialMenuBase(android.app.Activity activity, int color, MaterialMenuDrawable.Stroke stroke, int transformDuration, int pressedDuration)
protected abstract void setActionBarSettings(android.app.Activity activity)
protected abstract android.view.View getActionBarHomeView(android.app.Activity activity)
protected abstract android.view.View getActionBarUpView(android.app.Activity activity)
protected abstract boolean providesActionBar()
public final void setState(MaterialMenuDrawable.IconState state)
MaterialMenu
setState
在接口中 MaterialMenu
state
- new icon statepublic final MaterialMenuDrawable.IconState getState()
MaterialMenu
getState
在接口中 MaterialMenu
public final void animateState(MaterialMenuDrawable.IconState state)
MaterialMenu
animateState
在接口中 MaterialMenu
state
- new icon statepublic final void animatePressedState(MaterialMenuDrawable.IconState state)
MaterialMenu
animatePressedState
在接口中 MaterialMenu
state
- new icon statepublic final void setColor(int color)
MaterialMenu
setColor
在接口中 MaterialMenu
color
- new icon colorpublic final void setTransformationDuration(int duration)
MaterialMenu
setTransformationDuration
在接口中 MaterialMenu
duration
- new animation durationpublic final void setPressedDuration(int duration)
MaterialMenu
setPressedDuration
在接口中 MaterialMenu
duration
- new animation durationpublic final void setInterpolator(android.view.animation.Interpolator interpolator)
MaterialMenu
setInterpolator
在接口中 MaterialMenu
interpolator
- new interpolatorpublic final void setRTLEnabled(boolean rtlEnabled)
MaterialMenu
setRTLEnabled
在接口中 MaterialMenu
rtlEnabled
- true to enable RTL layoutpublic final void setTransformationOffset(MaterialMenuDrawable.AnimationState animationState, float value)
MaterialMenu
MaterialMenuDrawable.AnimationState
setTransformationOffset
在接口中 MaterialMenu
animationState
- state to set value invalue
- between MaterialMenuDrawable.TRANSFORMATION_START
and
MaterialMenuDrawable.TRANSFORMATION_END
.public final MaterialMenuDrawable getDrawable()
getDrawable
在接口中 MaterialMenu
MaterialMenuDrawable
to be used for the menupublic final void setNeverDrawTouch(boolean neverDrawTouch)
animatePressedState(com.marshalchen.common.ui.materialmenu.MaterialMenuDrawable.IconState)
neverDrawTouch
- true to never draw pressed state circle animationpublic void onSaveInstanceState(android.os.Bundle outState)
Activity.onSaveInstanceState(android.os.Bundle)
to store current icon stateoutState
- outStatepublic void syncState(android.os.Bundle state)
Activity.onPostCreate(android.os.Bundle)
to restore icon statestate
- state