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_NORMAL

    Fields inherited from class androidx.fragment.app.Fragment

    mPreviousWho
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    newInstance(String title, String content, String requestKey)
    Instantiate the popup with the provided title and content fields.
    newInstance(String title, String content, String requestKey, boolean textInput)
    Instantiate the popup with the provided title and content fields.
    newInstance(String title, String content, String requestKey, boolean textInput, String[] spinnerCategories)
    Instantiate the popup with the provided title and content fields.
    android.app.Dialog
    onCreateDialog(android.os.Bundle savedInstanceState)
     
    android.view.View
    onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
     
    void
    onDismiss(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, showNow

    Methods 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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 have
      content - The text content that the popup should show
      requestKey - The requestKey that should be used when returning the result
      textInput - Whether to take in text input from the user
      spinnerCategories - 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 have
      content - The text content that the popup should show
      requestKey - The requestKey that should be used when returning the result
      textInput - 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 have
      content - The text content that the popup should show
      requestKey - 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:
      onCreateView in class androidx.fragment.app.Fragment
    • onCreateDialog

      @NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState)
      Overrides:
      onCreateDialog in class androidx.fragment.app.DialogFragment
    • onDismiss

      public void onDismiss(@NonNull android.content.DialogInterface dialog)
      Specified by:
      onDismiss in interface android.content.DialogInterface.OnDismissListener
      Overrides:
      onDismiss in class androidx.fragment.app.DialogFragment