Class GiftcardsListFragment<A extends GiftcardsAdapter,V extends GiftcardsListView,P extends GiftcardsListPresenter<V>>
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V,P>
-
- com.cheetahdigital.uikit.architecture.lce.LceFragmentView<V,P>
-
- com.cheetahdigital.uikit.architecture.refreshable.RefreshableFragmentView<V,P>
-
- com.cheetahdigital.uikit.widget.list.ListFragmentView<V,P>
-
- com.cheetahdigital.uikit.widget.list.EndlessListFragmentView<A,V,P>
-
- com.cheetahdigital.giftcards.ui.list.GiftcardsListFragment<A,V,P>
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
,AnalyticsManager.AnalyticsScreen
,GiftcardsListView
,LceView
,MvpLceView
,MvpView
,RefreshableView
,EndlessListView
,ListView
public class GiftcardsListFragment<A extends GiftcardsAdapter,V extends GiftcardsListView,P extends GiftcardsListPresenter<V>> extends EndlessListFragmentView<A,V,P> implements GiftcardsListView, AnalyticsManager.AnalyticsScreen
The fragment class for showing the list ofGiftcard
.To include any changes in parameter, pass on a
GiftcardParams
usingIntentKey.PRIMARY_PARAMS
To implement external purchase page, override this method
showExternalPurchaseScreen(String)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GIFTCARD_CLASS
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.EndlessListFragmentView
mEndlessRecyclerOnScrollListener
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.ListFragmentView
mLinearLayoutManager, mListView, mSelectedPosition
-
Fields inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshableFragmentView
mSwipeRefreshLayout
-
Fields inherited from class com.cheetahdigital.uikit.architecture.lce.LceFragmentView
mContentView, mErrorView, mInitialLoad, mLoadingView
-
-
Constructor Summary
Constructors Constructor Description GiftcardsListFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendGiftcardsList(java.util.List<Giftcard> giftcards, int totalEntries)
This notifies the view to append a list ofGiftcard
to the existing list fromGiftcardsListView.showGiftcardsList(List, int)
protected GiftcardsAdapter
createGiftcardsAdapter()
Create an instance ofGiftcardsAdapter
.protected androidx.recyclerview.widget.RecyclerView.ItemDecoration
createItemDecoration()
Create the item decoration 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 Androidandroid.view.View
onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
void
processSuccessfulPurchaseResponse(PurchaseResponse response)
This notifies the view that gift card purchase API has respondedprotected void
purchaseAction()
Override this method to change the purchase implementation for Giftcardvoid
purchaseFailed(java.lang.String error)
This notifies the view that gift card purchase API has failedprotected void
showDetailsPostPurchase(java.lang.String cardNumber)
By default this calls the Giftcard Details Screen for the bought Purchaseprotected void
showExternalPurchaseScreen(java.lang.String hostedPageUrl)
Implementation of the external purchase screen By default this does nothingvoid
showGiftcardsList(java.util.List<Giftcard> giftcards, int totalEntries)
This notifies the view to show the list ofGiftcard
-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListFragmentView
onFinishLoadMore, onFinishRefresh, onLoadMoreFailed, setListTotalEntries
-
Methods inherited from class com.cheetahdigital.uikit.widget.list.ListFragmentView
getLayoutManager, isListAnimationEnabled, onAttach, setExitTransition, showContent, startActivity, startActivityForResult
-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshableFragmentView
onRefresh, onRefreshFailed, reloadData, showError, showLoading, startRefresh
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LceFragmentView
onLoadFailed, onLoadSuccess, onViewCreated, setErrorViewClickListener
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
captureSharedElementValues, getPresenter, getScreenName, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onDestroyView
-
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
getScreenName
-
Methods inherited from interface com.cheetahdigital.uikit.widget.list.EndlessListView
onFinishLoadMore, onLoadMoreFailed
-
Methods inherited from interface com.cheetahdigital.uikit.architecture.lce.LceView
onLoadFailed, onLoadSuccess, setErrorViewClickListener
-
Methods inherited from interface com.cheetahdigital.uikit.architecture.lce.MvpLceView
showContent, showError, showLoading
-
Methods inherited from interface com.cheetahdigital.uikit.architecture.refreshable.RefreshableView
onFinishRefresh, onRefreshFailed
-
-
-
-
Field Detail
-
GIFTCARD_CLASS
public static final java.lang.String GIFTCARD_CLASS
- See Also:
- Constant Field Values
-
-
Method Detail
-
onCreateView
@Nullable public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
- Overrides:
onCreateView
in classEndlessListFragmentView<A extends GiftcardsAdapter,V extends GiftcardsListView,P extends GiftcardsListPresenter<V>>
-
showGiftcardsList
public void showGiftcardsList(java.util.List<Giftcard> giftcards, int totalEntries)
Description copied from interface:GiftcardsListView
This notifies the view to show the list ofGiftcard
- Specified by:
showGiftcardsList
in interfaceGiftcardsListView
- Parameters:
giftcards
- list ofGiftcard
totalEntries
- total number of items
-
appendGiftcardsList
public void appendGiftcardsList(java.util.List<Giftcard> giftcards, int totalEntries)
Description copied from interface:GiftcardsListView
This notifies the view to append a list ofGiftcard
to the existing list fromGiftcardsListView.showGiftcardsList(List, int)
- Specified by:
appendGiftcardsList
in interfaceGiftcardsListView
- Parameters:
giftcards
- list ofGiftcard
for a certain pagetotalEntries
- total number of items
-
processSuccessfulPurchaseResponse
public void processSuccessfulPurchaseResponse(PurchaseResponse response)
Description copied from interface:GiftcardsListView
This notifies the view that gift card purchase API has responded- Specified by:
processSuccessfulPurchaseResponse
in interfaceGiftcardsListView
- Parameters:
response
- purchase response
-
purchaseFailed
public void purchaseFailed(java.lang.String error)
Description copied from interface:GiftcardsListView
This notifies the view that gift card purchase API has failed- Specified by:
purchaseFailed
in interfaceGiftcardsListView
- Parameters:
error
- error
-
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 GiftcardsListView,P extends GiftcardsListPresenter<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 GiftcardsListView,P extends GiftcardsListPresenter<V>>
- Returns:
- return the
MvpBasePresenter
-
createItemDecoration
protected androidx.recyclerview.widget.RecyclerView.ItemDecoration createItemDecoration()
Create the item decoration used in the RecyclerView. This invoked when initializing the list for the first time- Returns:
- instance of
RecyclerView.ItemDecoration
for the RecyclerView
-
createGiftcardsAdapter
protected GiftcardsAdapter createGiftcardsAdapter()
Create an instance ofGiftcardsAdapter
. Usually used ifGiftcardsAdapter
was subclassed.- Returns:
- instance of
GiftcardsAdapter
-
purchaseAction
protected void purchaseAction()
Override this method to change the purchase implementation for Giftcard
-
showDetailsPostPurchase
protected void showDetailsPostPurchase(java.lang.String cardNumber)
By default this calls the Giftcard Details Screen for the bought Purchase- Parameters:
cardNumber
- string card number of the purchased card
-
showExternalPurchaseScreen
protected void showExternalPurchaseScreen(java.lang.String hostedPageUrl)
Implementation of the external purchase screen By default this does nothing- Parameters:
hostedPageUrl
- value for the hosted page url
-
-