Class ProductComponentFragment<V extends ProductGroupComponentView,P extends ProductGroupComponentPresenter<V>>
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V,P>
-
- com.cheetahdigital.products.ui.component.ProductComponentFragment<V,P>
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,AnalyticsManager.AnalyticsScreen
,MvpView
public class ProductComponentFragment<V extends ProductGroupComponentView,P extends ProductGroupComponentPresenter<V>> extends MvpFragmentView<V,P>
This fragment shows a list ofProductComponentsAdapter
-
-
Constructor Summary
Constructors Constructor Description ProductComponentFragment(java.util.List<Component> productComponentList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VerticalSpaceItemDecoration
createItemDecoration()
Create theRecyclerView.ItemDecoration
used in the RecyclerView.protected P
createPresenter()
InstantiateMvpFragmentView.mPresenter
to be used for thisMvpActivityView
protected int
getContentLayoutId()
Provide the Content Layout ID which is of a Layout Resource Reference of Androidprotected ProductComponentsAdapter
getProductComponentsAdapter()
Create an adapter that shows list ofComponent
void
onAttach(android.content.Context context)
android.view.View
onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
void
setMaxSelection(int maxSelection)
Set current max selectionvoid
setTabPage(int tabPage)
Set current page on which the fragment is attached to-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
captureSharedElementValues, getPresenter, getScreenName, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onDestroyView, onViewCreated, startActivity, startActivityForResult
-
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
-
-
-
Constructor Detail
-
ProductComponentFragment
public ProductComponentFragment(java.util.List<Component> productComponentList)
-
-
Method Detail
-
onAttach
public void onAttach(@NonNull android.content.Context context)
- Overrides:
onAttach
in classMvpFragmentView<V extends ProductGroupComponentView,P extends ProductGroupComponentPresenter<V>>
-
onCreateView
@Nullable public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
- Overrides:
onCreateView
in classMvpFragmentView<V extends ProductGroupComponentView,P extends ProductGroupComponentPresenter<V>>
-
getContentLayoutId
protected int getContentLayoutId()
Description copied from class:MvpFragmentView
Provide the Content Layout ID which is of a Layout Resource Reference of Android- Specified by:
getContentLayoutId
in classMvpFragmentView<V extends ProductGroupComponentView,P extends ProductGroupComponentPresenter<V>>
- Returns:
- id of the content layout
-
createPresenter
protected P createPresenter()
Description copied from class:MvpFragmentView
InstantiateMvpFragmentView.mPresenter
to be used for thisMvpActivityView
- Specified by:
createPresenter
in classMvpFragmentView<V extends ProductGroupComponentView,P extends ProductGroupComponentPresenter<V>>
- Returns:
- return the
MvpBasePresenter
-
setTabPage
public void setTabPage(int tabPage)
Set current page on which the fragment is attached to- Parameters:
tabPage
- current tab page
-
setMaxSelection
public void setMaxSelection(int maxSelection)
Set current max selection- Parameters:
maxSelection
- number of components that can be selected
-
getProductComponentsAdapter
protected ProductComponentsAdapter getProductComponentsAdapter()
Create an adapter that shows list ofComponent
- Returns:
- instance of
ProductComponentsAdapter
-
createItemDecoration
protected VerticalSpaceItemDecoration createItemDecoration()
Create theRecyclerView.ItemDecoration
used in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
VerticalSpaceItemDecoration
used for item decoration
-
-