Package com.example.skeddly.ui.popup
Class StandardPopupDialogFragment
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
com.example.skeddly.ui.popup.StandardPopupDialogFragment
- All Implemented Interfaces:
android.content.ComponentCallbacks,android.content.DialogInterface.OnCancelListener,android.content.DialogInterface.OnDismissListener,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner
public class StandardPopupDialogFragment
extends androidx.fragment.app.DialogFragment
A generic popup that displays the provided title and content strings.
The result of this popup is a bundle that contains a single boolean,
indicating a positive or negative response from the user.
-
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 inherited from class androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMALFields inherited from class androidx.fragment.app.Fragment
mPreviousWho -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StandardPopupDialogFragmentnewInstance(String title, String content, String requestKey) Instantiate the popup with the provided title and content fields.static StandardPopupDialogFragmentnewInstance(String title, String content, String requestKey, boolean textInput) Instantiate the popup with the provided title and content fields.static StandardPopupDialogFragmentnewInstance(String title, String content, String requestKey, boolean textInput, String[] spinnerCategories) Instantiate the popup with the provided title and content fields.android.app.DialogonCreateDialog(android.os.Bundle savedInstanceState) android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) voidonDismiss(android.content.DialogInterface dialog) Methods inherited from class androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, isCancelable, onActivityCreated, onAttach, onCancel, onCreate, onDestroyView, onDetach, onGetLayoutInflater, onSaveInstanceState, onStart, onStop, onViewStateRestored, requireComponentDialog, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, show, show, showNowMethods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelCreationExtras, 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, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onViewCreated, 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, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
Constructor Details
-
StandardPopupDialogFragment
public StandardPopupDialogFragment()
-
-
Method Details
-
newInstance
public static StandardPopupDialogFragment newInstance(String title, String content, String requestKey, boolean textInput, String[] spinnerCategories) Instantiate the popup with the provided title and content fields.- Parameters:
title- The title that the popup should havecontent- The text content that the popup should showrequestKey- The requestKey that should be used when returning the resulttextInput- Whether to take in text input from the userspinnerCategories- If provided, show a spinner with the categories.- Returns:
- A new StandardPopupDialogFragment with the arguments passed to it to display.
-
newInstance
public static StandardPopupDialogFragment newInstance(String title, String content, String requestKey, boolean textInput) Instantiate the popup with the provided title and content fields.- Parameters:
title- The title that the popup should havecontent- The text content that the popup should showrequestKey- The requestKey that should be used when returning the resulttextInput- Whether to take in text input from the user- Returns:
- A new StandardPopupDialogFragment with the arguments passed to it to display.
-
newInstance
public static StandardPopupDialogFragment newInstance(String title, String content, String requestKey) Instantiate the popup with the provided title and content fields.- Parameters:
title- The title that the popup should havecontent- The text content that the popup should showrequestKey- The requestKey that should be used when returning the result- Returns:
- A new StandardPopupDialogFragment with the arguments passed to it to display.
-
onCreateView
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) - Overrides:
onCreateViewin classandroidx.fragment.app.Fragment
-
onCreateDialog
@NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) - Overrides:
onCreateDialogin classandroidx.fragment.app.DialogFragment
-
onDismiss
public void onDismiss(@NonNull android.content.DialogInterface dialog) - Specified by:
onDismissin interfaceandroid.content.DialogInterface.OnDismissListener- Overrides:
onDismissin classandroidx.fragment.app.DialogFragment
-