Class ReceiptsFragment<A extends ReceiptsAdapter,V extends ReceiptsView,P extends ReceiptsPresenter<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.receipt.ui.list.ReceiptsFragment<A,V,P>
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.activity.result.ActivityResultCaller
,androidx.lifecycle.HasDefaultViewModelProviderFactory
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
,com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
,ReceiptClickListener
,ReceiptsView
,com.cheetahdigital.uikit.architecture.lce.LceView
,com.cheetahdigital.uikit.architecture.lce.MvpLceView
,com.cheetahdigital.uikit.architecture.mvp.MvpView
,com.cheetahdigital.uikit.architecture.refreshable.RefreshableView
,com.cheetahdigital.uikit.widget.list.EndlessListView
,com.cheetahdigital.uikit.widget.list.ListView
public class ReceiptsFragment<A extends ReceiptsAdapter,V extends ReceiptsView,P extends ReceiptsPresenter<V>> extends com.cheetahdigital.uikit.widget.list.EndlessListFragmentView<A,V,P> implements ReceiptsView, ReceiptClickListener, com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
ExtendsEndlessListFragmentView
withReceiptsAdapter
as the adapter,ReceiptsFragment
as the view andReceiptsPresenter
as the presenter Can receive the following intent extras:IntentKey.PRIMARY_PARAMS
- theReceiptParams
to use
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.EndlessListFragmentView
mEndlessRecyclerOnScrollListener
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.ListFragmentView
mLinearLayoutManager, mListView, mSelectedPosition
-
-
Constructor Summary
Constructors Constructor Description ReceiptsFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ReceiptsAdapter
createAdapter()
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 Androidint
getScreenName()
android.view.View
onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
void
onReceiptClick(android.view.View itemView, Receipt receipt)
Abstract method called after clicking aReceipt
void
showReceipts(java.util.List<Receipt> receipts, int totalEntries)
This notifies the view when the call to the Receipt API is successfulvoid
updateReceipts(java.util.List<Receipt> receipts, int totalEntries)
This notifies the view when the call to the Receipt API is successful but compared to theReceiptsView.showReceipts(List, int)
this contains receipts for a certain page-
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, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onDestroyView
-
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, 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, registerForActivityResult, registerForActivityResult, 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.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
-
-
-
-
Method Detail
-
onCreateView
@Nullable public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
- Overrides:
onCreateView
in classcom.cheetahdigital.uikit.widget.list.EndlessListFragmentView<A extends ReceiptsAdapter,V extends ReceiptsView,P extends ReceiptsPresenter<V>>
-
createAdapter
protected ReceiptsAdapter createAdapter()
-
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
-
showReceipts
public void showReceipts(java.util.List<Receipt> receipts, int totalEntries)
Description copied from interface:ReceiptsView
This notifies the view when the call to the Receipt API is successful- Specified by:
showReceipts
in interfaceReceiptsView
- Parameters:
receipts
- list of receipt objectstotalEntries
- total number of entries regardless of pagination
-
updateReceipts
public void updateReceipts(java.util.List<Receipt> receipts, int totalEntries)
Description copied from interface:ReceiptsView
This notifies the view when the call to the Receipt API is successful but compared to theReceiptsView.showReceipts(List, int)
this contains receipts for a certain page- Specified by:
updateReceipts
in interfaceReceiptsView
- Parameters:
receipts
- list of receiptstotalEntries
- total entries regardless of pagination
-
getContentLayoutId
protected int getContentLayoutId()
Description copied from class:com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
Provide the Content Layout ID which is of a Layout Resource Reference of Android- Specified by:
getContentLayoutId
in classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends ReceiptsView,P extends ReceiptsPresenter<V>>
- Returns:
- id of the content layout
-
createPresenter
protected P createPresenter()
Description copied from class:com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
InstantiateMvpFragmentView.mPresenter
to be used for thisMvpActivityView
- Specified by:
createPresenter
in classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends ReceiptsView,P extends ReceiptsPresenter<V>>
- Returns:
- return the
MvpBasePresenter
-
getScreenName
public int getScreenName()
- Specified by:
getScreenName
in interfacecom.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
- Overrides:
getScreenName
in classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends ReceiptsView,P extends ReceiptsPresenter<V>>
-
onReceiptClick
public void onReceiptClick(android.view.View itemView, Receipt receipt)
Description copied from interface:ReceiptClickListener
Abstract method called after clicking aReceipt
- Specified by:
onReceiptClick
in interfaceReceiptClickListener
- Parameters:
itemView
- the view that was clickedreceipt
- the receipt clicked
-
-