Package com.cheetahdigital.event.ui.list
Class EventListFragment<A extends EventListAdapter,V extends EventListView,P extends EventListPresenter<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.event.ui.list.EventListFragment<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,EventListView,OnItemClickListener,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 EventListFragment<A extends EventListAdapter,V extends EventListView,P extends EventListPresenter<V>> extends com.cheetahdigital.uikit.widget.list.EndlessListFragmentView<A,V,P> implements EventListView, com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen, OnItemClickListener
The detail screen forEventListFragmentCan receive the following intent extras:ENABLE_FILTER-trueto use category filtering, elsefalseIntentKey.PRIMARY_PARAMS- instance ofEventsParamsto use forEventsAPIEVENT_LIST_DETAIL_RESPONSE_CODE- request code used when starting an intent upon clicking an event item
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringENABLE_FILTERstatic intEVENT_LIST_DETAIL_RESPONSE_CODE-
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 EventListFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendEventsList(java.util.List<Event> events, int totalEntries)Append the list to the current list presentprotected voidcaptureSharedElementValues(android.content.Intent intent)Captures the shared element and passes its values to intent.protected EventListAdaptercreateEventsAdapter()Create an instance ofEventListAdapter.protected com.cheetahdigital.uikit.widget.DividerItemDecorationcreateItemDecoration()Create theDividerItemDecorationused in the RecyclerView.protected PcreatePresenter()InstantiateMvpFragmentView.mPresenterto be used for thisMvpActivityViewprotected intgetContentLayoutId()Provide the Content Layout ID which is of a Layout Resource Reference of AndroidintgetScreenName()protected android.view.View[]getSharedElementViews()Fetches the shared element views.voidonActivityResult(int requestCode, int resultCode, android.content.Intent data)android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)voidonItemClick(Event event, android.view.View view, int position)Triggered when clicking an itemvoidshowEventsList(java.util.List<Event> events, int totalEntries)Shows the event listvoidupdateSpinnerCategories(java.util.List<java.lang.String> stringCategories, int postion)Update the spinner categories-
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
getPresenter, 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, 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
-
-
-
-
Field Detail
-
ENABLE_FILTER
public static final java.lang.String ENABLE_FILTER
- See Also:
- Constant Field Values
-
EVENT_LIST_DETAIL_RESPONSE_CODE
public static final int EVENT_LIST_DETAIL_RESPONSE_CODE
- 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 classcom.cheetahdigital.uikit.widget.list.EndlessListFragmentView<A extends EventListAdapter,V extends EventListView,P extends EventListPresenter<V>>
-
getContentLayoutId
protected int getContentLayoutId()
Description copied from class:com.cheetahdigital.uikit.architecture.mvp.MvpFragmentViewProvide the Content Layout ID which is of a Layout Resource Reference of Android- Specified by:
getContentLayoutIdin classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends EventListView,P extends EventListPresenter<V>>- Returns:
- id of the content layout
-
onActivityResult
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data)- Overrides:
onActivityResultin classandroidx.fragment.app.Fragment
-
captureSharedElementValues
protected void captureSharedElementValues(android.content.Intent intent)
Description copied from class:com.cheetahdigital.uikit.architecture.mvp.MvpFragmentViewCaptures the shared element and passes its values to intent.- Overrides:
captureSharedElementValuesin classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends EventListView,P extends EventListPresenter<V>>- Parameters:
intent-Intentto store the shared element values
-
getSharedElementViews
protected android.view.View[] getSharedElementViews()
Description copied from class:com.cheetahdigital.uikit.architecture.mvp.MvpFragmentViewFetches the shared element views.- Overrides:
getSharedElementViewsin classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends EventListView,P extends EventListPresenter<V>>- Returns:
- list of shared element
View
-
createPresenter
protected P createPresenter()
Description copied from class:com.cheetahdigital.uikit.architecture.mvp.MvpFragmentViewInstantiateMvpFragmentView.mPresenterto be used for thisMvpActivityView- Specified by:
createPresenterin classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends EventListView,P extends EventListPresenter<V>>- Returns:
- return the
MvpBasePresenter
-
showEventsList
public void showEventsList(java.util.List<Event> events, int totalEntries)
Description copied from interface:EventListViewShows the event list- Specified by:
showEventsListin interfaceEventListView- Parameters:
events- list ofEventto showtotalEntries- max number ofEvent
-
appendEventsList
public void appendEventsList(java.util.List<Event> events, int totalEntries)
Description copied from interface:EventListViewAppend the list to the current list present- Specified by:
appendEventsListin interfaceEventListView- Parameters:
events- list ofEventto appendtotalEntries- max number ofEvent
-
updateSpinnerCategories
public void updateSpinnerCategories(java.util.List<java.lang.String> stringCategories, int postion)Description copied from interface:EventListViewUpdate the spinner categories- Specified by:
updateSpinnerCategoriesin interfaceEventListView- Parameters:
stringCategories- list of categories to be populated in the spinnerpostion- index of the current selected category
-
getScreenName
public int getScreenName()
- Specified by:
getScreenNamein interfacecom.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen- Overrides:
getScreenNamein classcom.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends EventListView,P extends EventListPresenter<V>>
-
onItemClick
public void onItemClick(Event event, android.view.View view, int position)
Description copied from interface:OnItemClickListenerTriggered when clicking an item- Specified by:
onItemClickin interfaceOnItemClickListener- Parameters:
event- theEventclickedview- the current view selectedposition- position of the current view
-
createEventsAdapter
protected EventListAdapter createEventsAdapter()
Create an instance ofEventListAdapter. Usually used ifEventListAdapterwas subclassed.- Returns:
- instance of
EventListAdapter
-
createItemDecoration
protected com.cheetahdigital.uikit.widget.DividerItemDecoration createItemDecoration()
Create theDividerItemDecorationused in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
DividerItemDecoration
-
-