Class ViewContentBaseFragment<V extends ViewContentView,P extends ViewContentPresenter<V>>
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V,P>
-
- com.cheetahdigital.challenges.ui.responses.base.ChallengeResponseFragment<V,P>
-
- com.cheetahdigital.challenges.ui.responses.viewcontent.base.ViewContentBaseFragment<V,P>
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.view.View.OnClickListener
,android.view.View.OnCreateContextMenuListener
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,ChallengeResponseView
,ViewContentView
,AnalyticsManager.AnalyticsScreen
,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
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.challenges.ui.responses.base.ChallengeResponseFragment
CHALLENGE_ENABLE_RATING, CHALLENGE_FROM_DIALOG, CHALLENGE_ID_KEY, CHALLENGE_KEY, mProgressDialog, mShowAsAlert, mSubmitButton, RESPONDABLE_KEY, RESPONSE_ID_KEY, TAG
-
-
Constructor Summary
Constructors Constructor Description ViewContentBaseFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
confirmExit()
Confirm exitprotected P
createPresenter()
InstantiateMvpFragmentView.mPresenter
to be used for thisMvpActivityView
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 quizvoid
onViewCreated(android.view.View view, android.os.Bundle savedInstanceState)
protected void
showSubmitButton()
Show the submit button if challenge is shown as alertvoid
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 challengevoid
startQuiz()
Launch the quiz activityvoid
submitChallenge()
Finish the challenge by submitting a response or by showing a quiz-
Methods inherited from class com.cheetahdigital.challenges.ui.responses.base.ChallengeResponseFragment
getChallenge, getChallengeIdentifier, getResponseIdentifier, getRewardString, isAlert, onChallengeRespondSuccess, onClick, onCreate, sendRespondSuccessFragmentResult, showErrorMessage, showLoading, showReward
-
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, 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, 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, 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.challenges.ui.responses.base.ChallengeResponseView
onChallengeRespondSuccess, showErrorMessage, showLoading, showReward
-
Methods inherited from interface com.cheetahdigital.challenges.ui.responses.viewcontent.base.ViewContentView
loadContent
-
-
-
-
Method Detail
-
onViewCreated
public void onViewCreated(android.view.View view, android.os.Bundle savedInstanceState)
- Overrides:
onViewCreated
in classChallengeResponseFragment<V extends ViewContentView,P extends ViewContentPresenter<V>>
-
createPresenter
protected P createPresenter()
Description copied from class:MvpFragmentView
InstantiateMvpFragmentView.mPresenter
to be used for thisMvpActivityView
- Specified by:
createPresenter
in classMvpFragmentView<V extends ViewContentView,P extends ViewContentPresenter<V>>
- Returns:
- return the
MvpBasePresenter
-
onActivityCreated
public void onActivityCreated(@Nullable android.os.Bundle savedInstanceState)
- Overrides:
onActivityCreated
in classandroidx.fragment.app.Fragment
-
submitChallenge
public void submitChallenge()
Finish the challenge by submitting a response or by showing a quiz- Specified by:
submitChallenge
in classChallengeResponseFragment<V extends ViewContentView,P extends ViewContentPresenter<V>>
-
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 classandroidx.fragment.app.Fragment
-
startQuiz
public void startQuiz()
Launch the quiz activity- Specified by:
startQuiz
in interfaceViewContentView
-
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 interfaceViewContentView
- Parameters:
isExit
- true if the dialog is shown before exit
-
confirmExit
public void confirmExit()
Confirm exit- Specified by:
confirmExit
in interfaceViewContentView
-
showSubmitButton
protected void showSubmitButton()
Show the submit button if challenge is shown as alert
-
-