Class QuestionFragment
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cheetahdigital.challenges.ui.responses.multiquestion.base.QuestionFragment
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
- Direct Known Subclasses:
MultiChoiceQuestionFragment
,RatingQuestionFragment
,TextQuestionFragment
public abstract class QuestionFragment extends androidx.fragment.app.Fragment
Base class for theMultiChoiceQuestionFragment
questions Can receive the following intent extras:DEFINITION_KEY
- theDefinition
from the challengesIS_SURVEY_QUIZ_KEY
- true if the fragment was used as a survey quiz from view content challenges
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFINITION_KEY
The bundle key used for passingDefinition
datastatic java.lang.String
IS_SURVEY_QUIZ_KEY
The bundle key used for passing theSurveyResponseSetting
datastatic java.lang.String
TAG
The fragment tag
-
Constructor Summary
Constructors Constructor Description QuestionFragment()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List<Answer>
getAnswer()
Returns answers to the questionsabstract int
getContentLayoutId()
Provide the Content Layout ID which is of a Layout Resource Reference of Androidprotected boolean
isSurveyQuiz()
void
onActivityCreated(android.os.Bundle savedInstanceState)
void
onCreate(android.os.Bundle savedInstanceState)
android.view.View
onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
abstract void
showQuestion(Definition definition)
Show question-
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, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onViewCreated, 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, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
The fragment tag- See Also:
- Constant Field Values
-
DEFINITION_KEY
public static final java.lang.String DEFINITION_KEY
The bundle key used for passingDefinition
data- See Also:
- Constant Field Values
-
IS_SURVEY_QUIZ_KEY
public static final java.lang.String IS_SURVEY_QUIZ_KEY
The bundle key used for passing theSurveyResponseSetting
data- See Also:
- Constant Field Values
-
-
Method Detail
-
getContentLayoutId
@LayoutRes public abstract int getContentLayoutId()
Provide the Content Layout ID which is of a Layout Resource Reference of Android- Returns:
- resource id of the layout used
-
showQuestion
public abstract void showQuestion(Definition definition)
Show question- Parameters:
definition
- questionDefinition
-
getAnswer
public abstract java.util.List<Answer> getAnswer()
Returns answers to the questions- Returns:
- list of
Answer
-
onCreate
public void onCreate(@Nullable android.os.Bundle savedInstanceState)
- Overrides:
onCreate
in classandroidx.fragment.app.Fragment
-
onCreateView
@Nullable public android.view.View onCreateView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState)
- Overrides:
onCreateView
in classandroidx.fragment.app.Fragment
-
onActivityCreated
public void onActivityCreated(@Nullable android.os.Bundle savedInstanceState)
- Overrides:
onActivityCreated
in classandroidx.fragment.app.Fragment
-
isSurveyQuiz
protected boolean isSurveyQuiz()
- Returns:
- true if the fragment was used as a survey quiz from view content challenges, otherwise false
-
-