Class ViewContentBaseFragment<V extends ViewContentView,​P extends ViewContentPresenter<V>>

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner, ChallengeResponseView, ViewContentView, com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen, com.cheetahdigital.uikit.architecture.mvp.MvpView
    Direct Known Subclasses:
    ViewPhotoFragment, ViewUrlFragment, ViewYoutubeFragment

    public abstract class ViewContentBaseFragment<V extends ViewContentView,​P extends ViewContentPresenter<V>>
    extends ChallengeResponseFragment<V,​P>
    implements ViewContentView
    THe base response fragment for View Content Challenges
    • Nested Class Summary

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void confirmExit()
      Confirm exit
      protected P createPresenter()
      Instantiate MvpFragmentView.mPresenter to be used for this MvpActivityView
      void onActivityCreated​(android.os.Bundle savedInstanceState)  
      void onActivityResult​(int requestCode, int resultCode, android.content.Intent data)  
      void onBackPressed()
      Finish the challenge by submitting a response or by showing a quiz
      void onViewCreated​(android.view.View view, android.os.Bundle savedInstanceState)  
      protected void showSubmitButton()
      Show the submit button if challenge is shown as alert
      void showTakeQuizDialog​(boolean isExit)
      Ask user to take the quiz before closing the view content challenge if isExit = true, otherwise notify the user that the quiz must be done to complete the challenge
      void startQuiz()
      Launch the quiz activity
      void submitChallenge()
      Finish the challenge by submitting a response or by showing a quiz
      • Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView

        captureSharedElementValues, getContentLayoutId, getPresenter, getScreenName, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onAttach, onCreateView, 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, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, 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
    • Constructor Detail

      • ViewContentBaseFragment

        public ViewContentBaseFragment()
    • Method Detail

      • 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 ViewContentView,​P extends ViewContentPresenter<V>>
        Returns:
        return the MvpBasePresenter
      • onActivityCreated

        public void onActivityCreated​(@Nullable
                                      android.os.Bundle savedInstanceState)
        Overrides:
        onActivityCreated in class androidx.fragment.app.Fragment
      • onBackPressed

        public void onBackPressed()
        Finish the challenge by submitting a response or by showing a quiz
      • onActivityResult

        public void onActivityResult​(int requestCode,
                                     int resultCode,
                                     @Nullable
                                     android.content.Intent data)
        Overrides:
        onActivityResult in class androidx.fragment.app.Fragment
      • showTakeQuizDialog

        public void showTakeQuizDialog​(boolean isExit)
        Ask user to take the quiz before closing the view content challenge if isExit = true, otherwise notify the user that the quiz must be done to complete the challenge
        Specified by:
        showTakeQuizDialog in interface ViewContentView
        Parameters:
        isExit - true if the dialog is shown before exit
      • showSubmitButton

        protected void showSubmitButton()
        Show the submit button if challenge is shown as alert