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.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
,EventDateListView
,OnDateSelectedListener
,OnEventSelectedListener
,com.cheetahdigital.uikit.architecture.lce.LceView
,com.cheetahdigital.uikit.architecture.lce.MvpLceView
,com.cheetahdigital.uikit.architecture.mvp.MvpView
,com.cheetahdigital.uikit.architecture.refreshable.RefreshableView
public class EventDateListFragment<V extends EventDateListView,P extends EventDateListPresenter<V>> extends com.cheetahdigital.uikit.architecture.refreshable.RefreshableFragmentView<V,P> implements EventDateListView, OnDateSelectedListener, OnEventSelectedListener
The fragment class for showing the list ofEventDateListFragment
REQUEST_CODE_DETAILS
- request code used when starting intent upon selecting eventIntentKey.PRIMARY_PARAMS
-EventsParams
to use forEventsAPI
-
-
Field Summary
Fields Modifier and Type Field Description static int
REQUEST_CODE_DETAILS
-
Constructor Summary
Constructors Constructor Description EventDateListFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DateAdapter
createDateAdapter()
Create an instance ofDateAdapter
.protected com.cheetahdigital.uikit.widget.DividerItemDecoration
createDateAdapterItemDecoration()
Create theDividerItemDecoration
used in the RecyclerView.protected EventDateListAdapter
createEventsAdapter()
Create an instance ofEventDateListAdapter
.protected com.cheetahdigital.uikit.widget.DividerItemDecoration
createEventsAdapterItemDecoration()
Create theDividerItemDecoration
used in the RecyclerView.protected EventDateListAdapter
createFavoritesAdapter()
Create an instance ofEventDateListAdapter
.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()
void
initializeList(java.util.List<EventDate> dates)
Initialize the list after download.void
onActivityResult(int requestCode, int resultCode, android.content.Intent data)
void
onDateSelected(int index, EventDate date)
Called when a date is selectedvoid
onEventFavorited(Event event, boolean favorited)
Called when the event is favoritedvoid
onEventSelected(Event event)
Called when the event is selectedvoid
onViewCreated(android.view.View view, android.os.Bundle savedInstanceState)
void
showAllEvents()
Show all Events in the listvoid
showErrorToast(java.lang.String error)
Shows an errorvoid
showEventDates(java.util.List<EventDate> dates)
Shows the event on a specific datevoid
showEvents(EventDate date)
Show the events on current datevoid
showMyAgenda()
Show all Events favoritedvoid
updateEventList(java.util.List<Event> events)
Update the list of eventsvoid
updateFavoriteList(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, 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.architecture.lce.LceView
onLoadFailed, onLoadSuccess, setErrorViewClickListener
-
-
-
-
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: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 EventDateListView,P extends EventDateListPresenter<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 EventDateListView,P extends EventDateListPresenter<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 EventDateListView,P extends EventDateListPresenter<V>>
-
onViewCreated
public void onViewCreated(android.view.View view, @Nullable android.os.Bundle savedInstanceState)
- Overrides:
onViewCreated
in classcom.cheetahdigital.uikit.architecture.lce.LceFragmentView<V extends EventDateListView,P extends EventDateListPresenter<V>>
-
onActivityResult
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data)
- Overrides:
onActivityResult
in classandroidx.fragment.app.Fragment
-
showEventDates
public void showEventDates(java.util.List<EventDate> dates)
Description copied from interface:EventDateListView
Shows the event on a specific date- Specified by:
showEventDates
in interfaceEventDateListView
- Parameters:
dates
- instance ofEventDate
to use for updating event and favorite list
-
initializeList
public void initializeList(java.util.List<EventDate> dates)
Description copied from interface:EventDateListView
Initialize the list after download. This should be triggered only once due to calculating of nearest date on current date- Specified by:
initializeList
in interfaceEventDateListView
- Parameters:
dates
- list ofEventDate
to populate the dates and event list
-
onEventFavorited
public void onEventFavorited(Event event, boolean favorited)
Description copied from interface:OnEventSelectedListener
Called when the event is favorited- Specified by:
onEventFavorited
in interfaceOnEventSelectedListener
- Parameters:
event
- instance ofEvent
favorited
-true
is event is favorited, elsefalse
-
showErrorToast
public void showErrorToast(java.lang.String error)
Description copied from interface:EventDateListView
Shows an error- Specified by:
showErrorToast
in interfaceEventDateListView
- Parameters:
error
- info about the error
-
onDateSelected
public void onDateSelected(int index, EventDate date)
Description copied from interface:OnDateSelectedListener
Called when a date is selected- Specified by:
onDateSelected
in interfaceOnDateSelectedListener
- Parameters:
index
- position of the datedate
- instance ofEventDate
-
onEventSelected
public void onEventSelected(Event event)
Description copied from interface:OnEventSelectedListener
Called when the event is selected- Specified by:
onEventSelected
in 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:EventDateListView
Show the events on current date- Specified by:
showEvents
in interfaceEventDateListView
- Parameters:
date
- instance ofEventDate
used to populate the events
-
updateEventList
public void updateEventList(java.util.List<Event> events)
Description copied from interface:EventDateListView
Update the list of events- Specified by:
updateEventList
in interfaceEventDateListView
- Parameters:
events
- list ofEvent
to assign in current list
-
updateFavoriteList
public void updateFavoriteList(java.util.List<Event> events)
Description copied from interface:EventDateListView
Update the list of favorite events- Specified by:
updateFavoriteList
in interfaceEventDateListView
- Parameters:
events
- list of favoritedEvent
to assign in current list
-
createEventsAdapter
protected EventDateListAdapter createEventsAdapter()
Create an instance ofEventDateListAdapter
. Usually used ifEventDateListAdapter
was subclassed.- Returns:
- instance of
EventDateListAdapter
-
createFavoritesAdapter
protected EventDateListAdapter createFavoritesAdapter()
Create an instance ofEventDateListAdapter
. Usually used ifEventDateListAdapter
was subclassed.- Returns:
- instance of
EventDateListAdapter
that are favorited
-
createDateAdapter
protected DateAdapter createDateAdapter()
Create an instance ofDateAdapter
. Usually used ifDateAdapter
was subclassed.- Returns:
- instance of
DateAdapter
-
createDateAdapterItemDecoration
protected com.cheetahdigital.uikit.widget.DividerItemDecoration createDateAdapterItemDecoration()
Create theDividerItemDecoration
used in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
DividerItemDecoration
forDateAdapter
-
createEventsAdapterItemDecoration
protected com.cheetahdigital.uikit.widget.DividerItemDecoration createEventsAdapterItemDecoration()
Create theDividerItemDecoration
used in the RecyclerView. This will be invoked when initializing the list for the first time.- Returns:
- instance of
DividerItemDecoration
forEventDateListAdapter
-
-