Class OfferResponseListFragment<A extends OfferResponseAdapter,V extends OfferResponseListView,P extends OfferResponseListPresenter<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.EndlessListAndGridFragmentView<A,V,P>
-
- com.cheetahdigital.offers.ui.list.OfferResponseListFragment<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,OfferResponseClipListener,OfferResponseListView,LceView,MvpLceView,MvpView,RefreshableView,EndlessListView,ListView
public class OfferResponseListFragment<A extends OfferResponseAdapter,V extends OfferResponseListView,P extends OfferResponseListPresenter<V>> extends EndlessListAndGridFragmentView<A,V,P> implements OfferResponseListView, OfferResponseClipListener
List Fragment that extendsEndlessListAndGridFragmentViewhavingOfferResponseAdapteras the adapter,OfferResponseListViewas the view andOfferResponseListPresenteras the presenter The fragment also useOfferResponseListViewandOfferResponseClipListenerCan receive the following intent extras:SHOW_ZERO_POINT_AS_FREE- the flag for showing the amount text as "Free" if the metric amount is zero.OPEN_URL_DETAIL- the flag for showing offer in detail or in browser.IntentKey.PRIMARY_PARAMS- theOfferParamsto use.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOPEN_URL_DETAILstatic java.lang.StringSHOW_ZERO_POINT_AS_FREE-
Fields inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAndGridFragmentView
mEndlessRecyclerOnScrollListener, mGridLayoutManager
-
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 OfferResponseListFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendOfferResponseList(java.util.List<OfferResponse> offerResponse, int totalEntries)Notifies the view to append the existingOfferResponselist.protected androidx.recyclerview.widget.RecyclerView.ItemDecorationcreateItemDecoration()Create theRecyclerView.ItemDecorationused in the RecyclerView.protected OfferResponseAdaptercreateOfferResponseAdapter(OfferResponseClipListener listener)Create an instance ofOfferResponseAdapter.protected PcreatePresenter()InstantiateMvpFragmentView.mPresenterto be used for thisMvpActivityViewprotected intgetContentLayoutId()Provide the Content Layout ID which is of a Layout Resource Reference of AndroidintgetScreenName()android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)voidonOfferResponseClipped(OfferResponse offer, boolean isClipped)Callback when an offer response was clippedvoidrefreshList()Refresh the list by clearing the cache and recalling the GET offer response APIvoidshowOfferResponseList(java.util.List<OfferResponse> offerResponse, int totalEntries)Notifies the view to show theOfferResponselist.-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAndGridFragmentView
getCurrentPage, getGridViewNumColumns, getListTotalEntries, isGridView, onFinishLoadMore, onFinishRefresh, onLoadMoreFailed, setCurrentPage, setIsGridView, setListTotalEntries, setSpanSizeLookupForGridView
-
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, 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.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
-
SHOW_ZERO_POINT_AS_FREE
public static final java.lang.String SHOW_ZERO_POINT_AS_FREE
- See Also:
- Constant Field Values
-
OPEN_URL_DETAIL
public static final java.lang.String OPEN_URL_DETAIL
- 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:
onCreateViewin classEndlessListAndGridFragmentView<A extends OfferResponseAdapter,V extends OfferResponseListView,P extends OfferResponseListPresenter<V>>
-
getContentLayoutId
protected int getContentLayoutId()
Description copied from class:MvpFragmentViewProvide the Content Layout ID which is of a Layout Resource Reference of Android- Specified by:
getContentLayoutIdin classMvpFragmentView<V extends OfferResponseListView,P extends OfferResponseListPresenter<V>>- Returns:
- id of the content layout
-
createPresenter
protected P createPresenter()
Description copied from class:MvpFragmentViewInstantiateMvpFragmentView.mPresenterto be used for thisMvpActivityView- Specified by:
createPresenterin classMvpFragmentView<V extends OfferResponseListView,P extends OfferResponseListPresenter<V>>- Returns:
- return the
MvpBasePresenter
-
showOfferResponseList
public void showOfferResponseList(java.util.List<OfferResponse> offerResponse, int totalEntries)
Description copied from interface:OfferResponseListViewNotifies the view to show theOfferResponselist. This also means that the GET offer response API was successful- Specified by:
showOfferResponseListin interfaceOfferResponseListView- Parameters:
offerResponse- list of offer responsetotalEntries- total expected entries regardless of pagination
-
createItemDecoration
protected androidx.recyclerview.widget.RecyclerView.ItemDecoration createItemDecoration()
Create theRecyclerView.ItemDecorationused in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
RecyclerView.ItemDecorationfor the RecyclerView
-
createOfferResponseAdapter
protected OfferResponseAdapter createOfferResponseAdapter(OfferResponseClipListener listener)
Create an instance ofOfferResponseAdapter. Usually used ifOfferResponseAdapterwas subclassed.- Parameters:
listener- handles clipping/unclipping action- Returns:
- instance of
OfferResponseAdapter
-
appendOfferResponseList
public void appendOfferResponseList(java.util.List<OfferResponse> offerResponse, int totalEntries)
Description copied from interface:OfferResponseListViewNotifies the view to append the existingOfferResponselist. This also means that the GET offer response API with pagination was successful- Specified by:
appendOfferResponseListin interfaceOfferResponseListView- Parameters:
offerResponse- list of the next set of offer responsetotalEntries- total expected entries regardless of pagination
-
refreshList
public void refreshList()
Description copied from interface:OfferResponseListViewRefresh the list by clearing the cache and recalling the GET offer response API- Specified by:
refreshListin interfaceOfferResponseListView
-
onOfferResponseClipped
public void onOfferResponseClipped(OfferResponse offer, boolean isClipped)
Description copied from interface:OfferResponseClipListenerCallback when an offer response was clipped- Specified by:
onOfferResponseClippedin interfaceOfferResponseClipListener- Parameters:
offer- theOfferResponseisClipped- the action if the offer was clipped or unclipped
-
getScreenName
public int getScreenName()
- Specified by:
getScreenNamein interfaceAnalyticsManager.AnalyticsScreen- Overrides:
getScreenNamein classMvpFragmentView<V extends OfferResponseListView,P extends OfferResponseListPresenter<V>>
-
-