public abstract class MvpDialogFragment<V extends MvpView,P extends <any>> extends DialogFragment implements MvpDelegateCallback<V,P>
MvpPresenter to implement a Model-View-Presenter
architecture| Modifier and Type | Field and Description |
|---|---|
protected FragmentMvpDelegate<V,P> |
mvpDelegate |
protected P |
presenter
The presenter for this view.
|
| Constructor and Description |
|---|
MvpDialogFragment() |
| Modifier and Type | Method and Description |
|---|---|
abstract P |
createPresenter()
Creates a new presenter instance, if needed.
|
protected FragmentMvpDelegate<V,P> |
getMvpDelegate()
* Get the mvp delegate.
|
V |
getMvpView()
Gets the MvpView for the presenter
|
P |
getPresenter()
Gets the presenter.
|
void |
onActivityCreated(android.os.Bundle savedInstanceState) |
void |
onAttach(android.app.Activity activity) |
void |
onCreate(android.os.Bundle savedInstanceState) |
void |
onDestroy() |
void |
onDestroyView() |
void |
onDetach() |
void |
onPause() |
void |
onResume() |
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
onStart() |
void |
onStop() |
void |
onViewCreated(android.view.View view,
android.os.Bundle savedInstanceState) |
void |
setPresenter(P presenter)
Sets the presenter instance
|
protected FragmentMvpDelegate<V extends MvpView,P extends <any>> mvpDelegate
protected P extends <any> presenter
createPresenter()public abstract P createPresenter()
#setRetainInstance(boolean) is set to true. This method will be called from
onViewCreated(View, Bundle)createPresenter in interface MvpDelegateCallback<V extends MvpView,P extends <any>>protected FragmentMvpDelegate<V,P> getMvpDelegate()
Please note that only one instance of mvp delegate should be used per fragment instance.
Only override this method if you really know what you are doing.
FragmentMvpDelegateImplpublic P getPresenter()
MvpDelegateCallbackMvpDelegateCallback.createPresenter()getPresenter in interface MvpDelegateCallback<V extends MvpView,P extends <any>>public void setPresenter(P presenter)
MvpDelegateCallbacksetPresenter in interface MvpDelegateCallback<V extends MvpView,P extends <any>>presenter - The presenter instancepublic V getMvpView()
MvpDelegateCallbackgetMvpView in interface MvpDelegateCallback<V extends MvpView,P extends <any>>public void onViewCreated(android.view.View view,
android.os.Bundle savedInstanceState)
public void onDestroyView()
public void onCreate(android.os.Bundle savedInstanceState)
public void onDestroy()
public void onPause()
public void onResume()
public void onStart()
public void onStop()
public void onActivityCreated(android.os.Bundle savedInstanceState)
public void onAttach(android.app.Activity activity)
public void onDetach()
public void onSaveInstanceState(android.os.Bundle outState)