public abstract class MvpViewState<View extends MvpView>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<View> |
mInRestoreState |
protected ViewCommands<View> |
mViewCommands |
protected java.util.Set<View> |
mViews |
protected java.util.Map<View,java.util.Set<ViewCommand<View>>> |
mViewStates |
| Constructor and Description |
|---|
MvpViewState() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachView(View view)
Attach view to view state and apply saves state
|
void |
destroyView(View view) |
void |
detachView(View view)
Detach view from view state.
|
java.util.Set<View> |
getViews() |
protected java.lang.Boolean |
hasNotView() |
boolean |
isInRestoreState(View view)
Check if view is in restore state or not
|
protected void |
restoreState(View view,
java.util.Set<ViewCommand<View>> currentState)
Apply saved state to attached view
|
protected ViewCommands<View extends MvpView> mViewCommands
protected java.util.Map<View extends MvpView,java.util.Set<ViewCommand<View extends MvpView>>> mViewStates
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 view from view state. After this moment view state 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 - view for check