Class MvpViewState<View extends MvpView>

  • Direct Known Subclasses:
    DefaultViewState

    public abstract class MvpViewState<View extends MvpView>
    extends java.lang.Object
    • Constructor Detail

      • MvpViewState

        public MvpViewState()
    • Method Detail

      • restoreState

        protected void restoreState​(View view,
                                    java.util.Set<ViewCommand<View>> currentState)
        Apply a saved state to the attached view
        Parameters:
        view - mvp view to restore state
        currentState - commands that was applied already
      • hasNotView

        protected java.lang.Boolean hasNotView()
        Returns:
        true if the view state has one or more views, false otherwise (if the view state doesn't have any view)
      • attachView

        public void attachView​(View view)
        Attach view to view state and apply a saved state
        Parameters:
        view - attachment
      • destroyView

        public void destroyView​(View view)
      • getViews

        public java.util.Set<View> getViews()
        Returns:
        views attached to this view state instance
      • isInRestoreState

        public boolean isInRestoreState​(View view)
        Check if the view is in a restore state or not
        Parameters:
        view - a view for check
        Returns:
        true if this view state is restoring state to the given view. false otherwise.