Class EventDateListFragment<V extends EventDateListView,​P extends EventDateListPresenter<V>>

  • 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 of EventDateListFragment
    • Nested Class Summary

      • Nested classes/interfaces inherited from class androidx.fragment.app.Fragment

        androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int REQUEST_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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected DateAdapter createDateAdapter()
      Create an instance of DateAdapter.
      protected com.cheetahdigital.uikit.widget.DividerItemDecoration createDateAdapterItemDecoration()
      Create the DividerItemDecoration used in the RecyclerView.
      protected EventDateListAdapter createEventsAdapter()
      Create an instance of EventDateListAdapter.
      protected com.cheetahdigital.uikit.widget.DividerItemDecoration createEventsAdapterItemDecoration()
      Create the DividerItemDecoration used in the RecyclerView.
      protected EventDateListAdapter createFavoritesAdapter()
      Create an instance of EventDateListAdapter.
      protected P createPresenter()
      Instantiate MvpFragmentView.mPresenter to be used for this MvpActivityView
      protected int getContentLayoutId()
      Provide the Content Layout ID which is of a Layout Resource Reference of Android
      int 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 selected
      void onEventFavorited​(Event event, boolean favorited)
      Called when the event is favorited
      void onEventSelected​(Event event)
      Called when the event is selected
      void onViewCreated​(android.view.View view, android.os.Bundle savedInstanceState)  
      void showAllEvents()
      Show all Events in the list
      void showErrorToast​(java.lang.String error)
      Shows an error
      void showEventDates​(java.util.List<EventDate> dates)
      Shows the event on a specific date
      void showEvents​(EventDate date)
      Show the events on current date
      void showMyAgenda()
      Show all Events favorited
      void updateEventList​(java.util.List<Event> events)
      Update the list of events
      void 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
      • 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
    • Constructor Detail

      • EventDateListFragment

        public EventDateListFragment()
    • 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 class com.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
        Instantiate MvpFragmentView.mPresenter to be used for this MvpActivityView
        Specified by:
        createPresenter in class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends EventDateListView,​P extends EventDateListPresenter<V>>
        Returns:
        return the MvpBasePresenter
      • getScreenName

        public int getScreenName()
        Specified by:
        getScreenName in interface com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
        Overrides:
        getScreenName in class com.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 class com.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 class androidx.fragment.app.Fragment
      • 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 interface EventDateListView
        Parameters:
        dates - list of EventDate to populate the dates and event list
      • showErrorToast

        public void showErrorToast​(java.lang.String error)
        Description copied from interface: EventDateListView
        Shows an error
        Specified by:
        showErrorToast in interface EventDateListView
        Parameters:
        error - info about the error
      • showAllEvents

        public void showAllEvents()
        Show all Events in the list
      • showMyAgenda

        public void showMyAgenda()
        Show all Events favorited
      • updateFavoriteList

        public void updateFavoriteList​(java.util.List<Event> events)
        Description copied from interface: EventDateListView
        Update the list of favorite events
        Specified by:
        updateFavoriteList in interface EventDateListView
        Parameters:
        events - list of favorited Event to assign in current list
      • createDateAdapterItemDecoration

        protected com.cheetahdigital.uikit.widget.DividerItemDecoration createDateAdapterItemDecoration()
        Create the DividerItemDecoration used in the RecyclerView. This will be invoked when initializing the list for the first time.
        Returns:
        instance of DividerItemDecoration for DateAdapter
      • createEventsAdapterItemDecoration

        protected com.cheetahdigital.uikit.widget.DividerItemDecoration createEventsAdapterItemDecoration()
        Create the DividerItemDecoration used in the RecyclerView. This will be invoked when initializing the list for the first time.
        Returns:
        instance of DividerItemDecoration for EventDateListAdapter