MultiActionsProvider.MultiAction
public class MultiActionsProvider.MultiAction
MultiAction represents an action that can have multiple states. getIndex returns the current index within the drawables. Both list of drawables and index can be updated dynamically in the program, and the UI could be updated by notifying the listeners provided in AbstractMediaItemPresenter.ViewHolder.
Summary
Public constructors |
|---|
MultiAction(long id) |
Public methods |
|
|---|---|
Drawable |
|
Drawable[] |
Returns the drawables used for displaying different states within this |
long |
getId() |
int |
getIndex()Returns the currently selected index in this MultiAction. |
void |
Increments the index which this MultiAction currently represents. |
void |
setDrawables(Drawable[] drawables)Sets the drawables used for displaying different states within this |
void |
setIndex(int index)Sets the index which this MultiAction currently represents. |
Public constructors
Public methods
getCurrentDrawable
public Drawable getCurrentDrawable()
| Returns | |
|---|---|
Drawable |
The icon drawable for the current state of this MultiAction. |
getDrawables
public Drawable[] getDrawables()
Returns the drawables used for displaying different states within this MultiAction.
| Returns | |
|---|---|
Drawable[] |
The drawables used for displaying different states within this |
getIndex
public int getIndex()
Returns the currently selected index in this MultiAction.
| Returns | |
|---|---|
int |
The currently selected index in this MultiAction. |
incrementIndex
public void incrementIndex()
Increments the index which this MultiAction currently represents. The index is wrapped around to zero when the end is reached.
setDrawables
public void setDrawables(Drawable[] drawables)
Sets the drawables used for displaying different states within this MultiAction. The size of drawables determines the set of states this action represents.
| Parameters | |
|---|---|
Drawable[] drawables |
Array of drawables for different MultiAction states. |