Class EventDateListFragment<V extends EventDateListView,P extends EventDateListPresenter<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.event.ui.eventdate.list.EventDateListFragment<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,EventDateListView,OnDateSelectedListener,OnEventSelectedListener,LceView,MvpLceView,MvpView,RefreshableView
public class EventDateListFragment<V extends EventDateListView,P extends EventDateListPresenter<V>> extends RefreshableFragmentView<V,P> implements EventDateListView, OnDateSelectedListener, OnEventSelectedListener
The fragment class for showing the list ofEventDateListFragmentREQUEST_CODE_DETAILS- request code used when starting intent upon selecting eventIntentKey.PRIMARY_PARAMS-EventsParamsto use forEventsAPI
-
-
Field Summary
Fields Modifier and Type Field Description static intREQUEST_CODE_DETAILS-
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 EventDateListFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DateAdaptercreateDateAdapter()Create an instance ofDateAdapter.protected DividerItemDecorationcreateDateAdapterItemDecoration()Create theDividerItemDecorationused in the RecyclerView.protected EventDateListAdaptercreateEventsAdapter()Create an instance ofEventDateListAdapter.protected DividerItemDecorationcreateEventsAdapterItemDecoration()Create theDividerItemDecorationused in the RecyclerView.protected EventDateListAdaptercreateFavoritesAdapter()Create an instance ofEventDateListAdapter.protected PcreatePresenter()InstantiateMvpFragmentView.mPresenterto be used for thisMvpActivityViewprotected intgetContentLayoutId()Provide the Content Layout ID which is of a Layout Resource Reference of AndroidintgetScreenName()voidinitializeList(java.util.List<EventDate> dates)Initialize the list after download.voidonActivityResult(int requestCode, int resultCode, android.content.Intent data)voidonDateSelected(int index, EventDate date)Called when a date is selectedvoidonEventFavorited(Event event, boolean favorited)Called when the event is favoritedvoidonEventSelected(Event event)Called when the event is selectedvoidonViewCreated(android.view.View view, android.os.Bundle savedInstanceState)voidshowAllEvents()Show all Events in the listvoidshowErrorToast(java.lang.String error)Shows an errorvoidshowEventDates(java.util.List<EventDate> dates)Shows the event on a specific datevoidshowEvents(EventDate date)Show the events on current datevoidshowMyAgenda()Show all Events favoritedvoidupdateEventList(java.util.List<Event> events)Update the list of eventsvoidupdateFavoriteList(java.util.List<Event> events)Update the list of favorite events-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshableFragmentView
onCreateView, onFinishRefresh, onRefresh, onRefreshFailed, reloadData, showContent, showError, showLoading, startRefresh
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LceFragmentView
onLoadFailed, onLoadSuccess, setErrorViewClickListener
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
captureSharedElementValues, getPresenter, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onAttach, onDestroyView, 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, 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.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
-
REQUEST_CODE_DETAILS
public static final int REQUEST_CODE_DETAILS
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 EventDateListView,P extends EventDateListPresenter<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 EventDateListView,P extends EventDateListPresenter<V>>- Returns:
- return the
MvpBasePresenter
-
getScreenName
public int getScreenName()
- Specified by:
getScreenNamein interfaceAnalyticsManager.AnalyticsScreen- Overrides:
getScreenNamein classMvpFragmentView<V extends EventDateListView,P extends EventDateListPresenter<V>>
-
onViewCreated
public void onViewCreated(android.view.View view, @Nullable android.os.Bundle savedInstanceState)- Overrides:
onViewCreatedin classLceFragmentView<V extends EventDateListView,P extends EventDateListPresenter<V>>
-
onActivityResult
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data)- Overrides:
onActivityResultin classandroidx.fragment.app.Fragment
-
showEventDates
public void showEventDates(java.util.List<EventDate> dates)
Description copied from interface:EventDateListViewShows the event on a specific date- Specified by:
showEventDatesin interfaceEventDateListView- Parameters:
dates- instance ofEventDateto use for updating event and favorite list
-
initializeList
public void initializeList(java.util.List<EventDate> dates)
Description copied from interface:EventDateListViewInitialize the list after download. This should be triggered only once due to calculating of nearest date on current date- Specified by:
initializeListin interfaceEventDateListView- Parameters:
dates- list ofEventDateto populate the dates and event list
-
onEventFavorited
public void onEventFavorited(Event event, boolean favorited)
Description copied from interface:OnEventSelectedListenerCalled when the event is favorited- Specified by:
onEventFavoritedin interfaceOnEventSelectedListener- Parameters:
event- instance ofEventfavorited-trueis event is favorited, elsefalse
-
showErrorToast
public void showErrorToast(java.lang.String error)
Description copied from interface:EventDateListViewShows an error- Specified by:
showErrorToastin interfaceEventDateListView- Parameters:
error- info about the error
-
onDateSelected
public void onDateSelected(int index, EventDate date)Description copied from interface:OnDateSelectedListenerCalled when a date is selected- Specified by:
onDateSelectedin interfaceOnDateSelectedListener- Parameters:
index- position of the datedate- instance ofEventDate
-
onEventSelected
public void onEventSelected(Event event)
Description copied from interface:OnEventSelectedListenerCalled when the event is selected- Specified by:
onEventSelectedin interfaceOnEventSelectedListener- Parameters:
event- instance ofEvent
-
showAllEvents
public void showAllEvents()
Show all Events in the list
-
showMyAgenda
public void showMyAgenda()
Show all Events favorited
-
showEvents
public void showEvents(EventDate date)
Description copied from interface:EventDateListViewShow the events on current date- Specified by:
showEventsin interfaceEventDateListView- Parameters:
date- instance ofEventDateused to populate the events
-
updateEventList
public void updateEventList(java.util.List<Event> events)
Description copied from interface:EventDateListViewUpdate the list of events- Specified by:
updateEventListin interfaceEventDateListView- Parameters:
events- list ofEventto assign in current list
-
updateFavoriteList
public void updateFavoriteList(java.util.List<Event> events)
Description copied from interface:EventDateListViewUpdate the list of favorite events- Specified by:
updateFavoriteListin interfaceEventDateListView- Parameters:
events- list of favoritedEventto assign in current list
-
createEventsAdapter
protected EventDateListAdapter createEventsAdapter()
Create an instance ofEventDateListAdapter. Usually used ifEventDateListAdapterwas subclassed.- Returns:
- instance of
EventDateListAdapter
-
createFavoritesAdapter
protected EventDateListAdapter createFavoritesAdapter()
Create an instance ofEventDateListAdapter. Usually used ifEventDateListAdapterwas subclassed.- Returns:
- instance of
EventDateListAdapterthat are favorited
-
createDateAdapter
protected DateAdapter createDateAdapter()
Create an instance ofDateAdapter. Usually used ifDateAdapterwas subclassed.- Returns:
- instance of
DateAdapter
-
createDateAdapterItemDecoration
protected DividerItemDecoration createDateAdapterItemDecoration()
Create theDividerItemDecorationused in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
DividerItemDecorationforDateAdapter
-
createEventsAdapterItemDecoration
protected DividerItemDecoration createEventsAdapterItemDecoration()
Create theDividerItemDecorationused in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
DividerItemDecorationforEventDateListAdapter
-
-