Klasse SimplePinDialog

java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
Alle implementierten Schnittstellen:
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 SimplePinDialog extends CustomViewDialog<SimplePinDialog>
An simple dialog with an pin field.

Required pin can be specified You can also use an SimpleInputDialog.InputValidator to validate input.

Results: PIN String The entered pin code

Created by eltos on 14.10.2015.

  • Verschachtelte Klassen - Übersicht

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen eltos.simpledialogfragment.SimpleDialog

    SimpleDialog.OnDialogResultListener

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen androidx.fragment.app.Fragment

    androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    protected static final String
     
    protected static final String
     
    protected static final String
     
    static final String
     
    static final String
     

    Von Klasse geerbte Felder androidx.fragment.app.DialogFragment

    STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL

    Von Klasse geerbte Felder androidx.fragment.app.Fragment

    mPreviousWho
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected boolean
    Overwrite this method to catch positive button presses, e.g. if you need to verify input by the user
     
     
    length(int length)
    Sets the pin codes length (default is 4 digits)
    android.view.View
    onCreateContentView(android.os.Bundle savedInstanceState)
    Inflate your custom view here.
    protected void
    Overwrite this method to take action once the dialog is shown such as settings an input focus, showing the keyboard or setting the initial positiveButtonState
    android.os.Bundle
    onResult(int which)
    Overwrite this method to provide additional results from your custom view to be passed to the SimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
    void
    onSaveInstanceState(android.os.Bundle outState)
     
    protected String
     
    void
    Helper for opening the soft keyboard
    pin(String pin)
    Sets the required pin to check for.
    protected boolean
     

    Von Klasse geerbte Methoden androidx.fragment.app.DialogFragment

    dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onDismiss, onGetLayoutInflater, onStart, onStop, onViewStateRestored, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, showNow

    Von Klasse geerbte Methoden androidx.fragment.app.Fragment

    dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, 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, onCreateView, 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

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Felddetails

  • Konstruktordetails

    • SimplePinDialog

      public SimplePinDialog()
  • Methodendetails

    • build

      public static SimplePinDialog build()
    • length

      public SimplePinDialog length(int length)
      Sets the pin codes length (default is 4 digits)
      Parameter:
      length - the code length
      Gibt zurück:
      this instance
    • pin

      public SimplePinDialog pin(String pin)
      Sets the required pin to check for. When set, the dialog will not close with BUTTON_POSITIVE until this exact pin was entered.
      Parameter:
      pin - the correct pin
      Gibt zurück:
      this instance
    • onValidateInput

      protected String onValidateInput(@Nullable String input)
    • getText

      @Nullable public String getText()
      Gibt zurück:
      the current text or null
    • openKeyboard

      public void openKeyboard()
      Helper for opening the soft keyboard
    • onCreateContentView

      public android.view.View onCreateContentView(android.os.Bundle savedInstanceState)
      Beschreibung aus Klasse kopiert: CustomViewDialog
      Inflate your custom view here.
      Angegeben von:
      onCreateContentView in Klasse CustomViewDialog<SimplePinDialog>
      Parameter:
      savedInstanceState - The last saved instance state of the Fragment, or null if this fragment is created for the first time.
      Gibt zurück:
      Return a new View to be displayed by the Fragment.
    • posEnabled

      protected boolean posEnabled()
    • onDialogShown

      protected void onDialogShown()
      Beschreibung aus Klasse kopiert: CustomViewDialog
      Overwrite this method to take action once the dialog is shown such as settings an input focus, showing the keyboard or setting the initial positiveButtonState
      Setzt außer Kraft:
      onDialogShown in Klasse CustomViewDialog<SimplePinDialog>
    • acceptsPositiveButtonPress

      protected boolean acceptsPositiveButtonPress()
      Beschreibung aus Klasse kopiert: CustomViewDialog
      Overwrite this method to catch positive button presses, e.g. if you need to verify input by the user

      Note: do not call CustomViewDialog.pressPositiveButton() here!

      Setzt außer Kraft:
      acceptsPositiveButtonPress in Klasse CustomViewDialog<SimplePinDialog>
      Gibt zurück:
      false to ignore the press, true to process normally
    • onResult

      public android.os.Bundle onResult(int which)
      Beschreibung aus Klasse kopiert: CustomViewDialog
      Overwrite this method to provide additional results from your custom view to be passed to the SimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
      Setzt außer Kraft:
      onResult in Klasse CustomViewDialog<SimplePinDialog>
      Parameter:
      which - see SimpleDialog.OnDialogResultListener
      Gibt zurück:
      the bundle to merge with the results or null
    • onSaveInstanceState

      public void onSaveInstanceState(@NonNull android.os.Bundle outState)
      Setzt außer Kraft:
      onSaveInstanceState in Klasse androidx.fragment.app.DialogFragment