public abstract class MvpViewState<View extends MvpView>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<View> |
inRestoreState |
protected ViewCommands<View> |
viewCommands |
protected java.util.Set<View> |
views |
protected java.util.Map<View,java.util.Set<ViewCommand<View>>> |
viewStates |
| Constructor and Description |
|---|
MvpViewState() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachView(View view)
Attach view to view state and apply a saved state
|
void |
destroyView(View view) |
void |
detachView(View view)
Detach a view from the view state.
|
java.util.Set<View> |
getViews() |
protected java.lang.Boolean |
hasNotView() |
boolean |
isInRestoreState(View view)
Check if the view is in a restore state or not
|
protected void |
restoreState(View view,
java.util.Set<ViewCommand<View>> currentState)
Apply a saved state to the attached view
|
protected ViewCommands<View extends MvpView> viewCommands
protected java.util.Map<View extends MvpView,java.util.Set<ViewCommand<View extends MvpView>>> viewStates
protected void restoreState(View view, java.util.Set<ViewCommand<View>> currentState)
view - mvp view to restore statecurrentState - commands that was applied alreadyprotected java.lang.Boolean hasNotView()
public void attachView(View view)
view - attachmentpublic void detachView(View view)
Detach a view from the view state. After this call view state will save
commands via StateStrategy.beforeApply(List, ViewCommand).
view - target mvp view to detachpublic void destroyView(View view)
public java.util.Set<View> getViews()
public boolean isInRestoreState(View view)
view - a view for check