Class EditLabelDialogFragment

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnDismissListener, android.view.View.OnCreateContextMenuListener, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

    public class EditLabelDialogFragment
    extends androidx.fragment.app.DialogFragment
    This is a dialog for use when getting a text input from the user. A title and a default value can be passed to be used when displaying the dialog. When the user taps okay after adding a text input, a set EditLabelDialogFragment.OnLabelEditedListener will be used to pass the value. Call the setOnLabelEditedListener() to set this listener.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  EditLabelDialogFragment.OnLabelEditedListener
      Listens for when the user confirms setting a text value
      • 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static EditLabelDialogFragment newInstance​(java.lang.String title, java.lang.String label)
      Creates a new instance of this dialog fragment.
      android.app.Dialog onCreateDialog​(android.os.Bundle savedInstanceState)  
      void setOnLabelEditedListener​(EditLabelDialogFragment.OnLabelEditedListener onLabelEditedListener)
      Sets the listener that will be called when user successfully sets a value as input.
      • Methods inherited from class androidx.fragment.app.DialogFragment

        dismiss, dismissAllowingStateLoss, getDialog, getShowsDialog, getTheme, isCancelable, onActivityCreated, onAttach, onCancel, onCreate, onDestroyView, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, onStart, onStop, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, show, show, showNow
      • 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, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, 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
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EditLabelDialogFragment

        public EditLabelDialogFragment()
    • Method Detail

      • newInstance

        public static EditLabelDialogFragment newInstance​(java.lang.String title,
                                                          java.lang.String label)
        Creates a new instance of this dialog fragment. A title and/or a default value may be passed for customization purposes.
        Parameters:
        title - Custom title for the dialog.
        label - Default value of the text.
        Returns:
        The instance of this dialog fragment.
      • setOnLabelEditedListener

        public void setOnLabelEditedListener​(EditLabelDialogFragment.OnLabelEditedListener onLabelEditedListener)
        Sets the listener that will be called when user successfully sets a value as input.
        Parameters:
        onLabelEditedListener - The listener to be used.
      • onCreateDialog

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