Package moxy

Class MvpDelegate<Delegated>

    • Field Detail

      • MOXY_DELEGATE_TAGS_KEY

        public static final java.lang.String MOXY_DELEGATE_TAGS_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • MvpDelegate

        public MvpDelegate​(Delegated delegated)
    • Method Detail

      • setParentDelegate

        public void setParentDelegate​(MvpDelegate delegate,
                                      java.lang.String childId)
      • freeParentDelegate

        public void freeParentDelegate()
        Free self link from children list (childDelegates) in parent delegate property parentDelegate stay keep link to parent delegate for access to parent bundle for save state in onSaveInstanceState()
      • removeAllChildDelegates

        public void removeAllChildDelegates()
      • onCreate

        public void onCreate()

        Similar like onCreate(Bundle). But this method try to get saved state from parent presenter before get presenters

      • onCreate

        public void onCreate​(android.os.Bundle bundle)

        Get(or create if not exists) presenters for delegated object and bind them to this object fields

        Parameters:
        bundle - with saved state
      • onAttach

        public void onAttach()

        Attach delegated object as a View into presenter fields of this object. If delegate wasn't introduced in onCreate(Bundle) (or onCreate()) before call to this method, the view will not be attached to its presenters

      • onDetach

        public void onDetach()

        Detach delegated object from its presenters.

      • onDestroyView

        public void onDestroyView()

        View was being destroyed, but logical unit is still alive

      • onDestroy

        public void onDestroy()

        Destroy presenters.

      • onSaveInstanceState

        public void onSaveInstanceState()

        Similar like onSaveInstanceState(Bundle). But this method tries to save its state to the parent presenter Bundle

      • onSaveInstanceState

        public void onSaveInstanceState​(android.os.Bundle outState)
        Saves presenters. Tag prefix to save state to restore presenters in the future after the delegate will be recreated
        Parameters:
        outState - out state from Android component
      • getChildrenSaveState

        public android.os.Bundle getChildrenSaveState()
      • registerExternalPresenterField

        public void registerExternalPresenterField​(PresenterField<? super Delegated> field)