T_Presenter
- The parametrised type of the Presenter
.public abstract class ViewFragment<T_Presenter extends Presenter> extends android.app.Fragment implements View, PresentedView<T_Presenter>, Scopeable
ViewFragment
provides an abstract base class for concrete Fragment
implementations
that are used as View
components in Robopupu MVP implementation.KEY_DEPENDENCY_SCOPE
Modifier | Constructor and Description |
---|---|
protected |
ViewFragment() |
Modifier and Type | Method and Description |
---|---|
<T extends ViewBinding<?>> |
bind(int viewId)
Creates and binds a
ViewBinding to a View specified by the given view id. |
android.widget.AdapterView |
bind(int viewId,
AdapterViewBinding<?> binding,
AdapterViewBinding.Adapter<?> adapter)
Binds the given
AdapterViewBinding to the specified AdapterView . |
<T extends android.view.View> |
bind(int viewId,
ViewBinding<T> binding)
Binds the given
ViewBinding to the specified View . |
abstract T_Presenter |
getPresenter()
Gets the
Presenter assigned for this ViewCompatActivity . |
DependencyScope |
getScope() |
ViewState |
getState()
|
<T extends android.view.View> |
getView(int viewId)
Looks up and returns a
View with the given layout id. |
java.lang.String |
getViewTag()
Get a tag for this
View . |
void |
onActivityCreated(android.os.Bundle inState) |
protected void |
onCreateBindings()
Invoked to bind
ViewBinding s to View s. |
void |
onDestroy() |
void |
onPause() |
protected void |
onRestoreDependencies(DependencyMap dependencies)
This method can be overridden to restore dependencies after the
ViewFragment is
restored, for instance, after recreating it. |
protected void |
onRestoreState(android.os.Bundle inState)
This method can be overridden to restore state of this
ViewFragment from the given
Bundle . |
void |
onResume() |
protected void |
onSaveDependencies(DependencyMap dependencies)
This method can be overridden to save dependencies after the
ViewFragment is
restored, for instance, after recreating it. |
void |
onSaveInstanceState(android.os.Bundle outState) |
protected void |
onSaveState(android.os.Bundle outState)
This method can be overridden to save state of this
ViewFragment to the given
Bundle . |
void |
onStart() |
void |
onStop() |
void |
onViewCreated(android.view.View view,
android.os.Bundle inState) |
protected T_Presenter |
resolvePresenter()
Resolves the
Presenter assigned for this ViewCompatActivity . |
void |
setScope(DependencyScope scope) |
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isVisible, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroyOptionsMenu, onDestroyView, onDetach, onHiddenChanged, onInflate, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onTrimMemory, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, toString, unregisterForContextMenu
public abstract T_Presenter getPresenter()
Presenter
assigned for this ViewCompatActivity
.getPresenter
in interface PresentedView<T_Presenter extends Presenter>
Presenter
.public java.lang.String getViewTag()
View
View
.getViewTag
in interface View
String
.protected T_Presenter resolvePresenter()
Presenter
assigned for this ViewCompatActivity
.Presenter
.public void onViewCreated(android.view.View view, android.os.Bundle inState)
onViewCreated
in class android.app.Fragment
public void onActivityCreated(android.os.Bundle inState)
onActivityCreated
in class android.app.Fragment
public void onStart()
onStart
in class android.app.Fragment
protected void onCreateBindings()
ViewBinding
s to View
s. This method has to be overridden in
classes extended from ViewFragment
.public void onResume()
onResume
in class android.app.Fragment
public void onStop()
onStop
in class android.app.Fragment
public void onPause()
onPause
in class android.app.Fragment
public void onDestroy()
onDestroy
in class android.app.Fragment
public void onSaveInstanceState(android.os.Bundle outState)
onSaveInstanceState
in class android.app.Fragment
protected void onSaveState(android.os.Bundle outState)
ViewFragment
to the given
Bundle
.outState
- A Bundle
.protected void onRestoreState(android.os.Bundle inState)
ViewFragment
from the given
Bundle
.inState
- A Bundle
.protected void onSaveDependencies(DependencyMap dependencies)
ViewFragment
is
restored, for instance, after recreating it.dependencies
- A DependencyMap
for saving the dependencies.protected void onRestoreDependencies(DependencyMap dependencies)
ViewFragment
is
restored, for instance, after recreating it.dependencies
- A DependencyMap
for restoring the dependencies.public <T extends android.view.View> T getView(int viewId)
View
with the given layout id.viewId
- A view id used in a layout XML resource.View
.public <T extends ViewBinding<?>> T bind(int viewId)
ViewBinding
to a View
specified by the given view id.T
- The parametrised type of the ViewDelagate.viewId
- A view id used in a layout XML resource.ViewBinding
.public <T extends android.view.View> T bind(int viewId, ViewBinding<T> binding)
ViewBinding
to the specified View
.viewId
- A view id in a layout XML specifying the target View
.binding
- An ViewBinding
.View
.public android.widget.AdapterView bind(int viewId, AdapterViewBinding<?> binding, AdapterViewBinding.Adapter<?> adapter)
AdapterViewBinding
to the specified AdapterView
.viewId
- A view id in a layout XML specifying the target AdapterView
.binding
- An AdapterViewBinding
.adapter
- An AdapterViewBinding.Adapter
that is assigned to AdapterViewBinding
.AdapterView
.public DependencyScope getScope()
public void setScope(DependencyScope scope)