Klasse CustomViewDialog<This extends CustomViewDialog<This>>

java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<This>
eltos.simpledialogfragment.CustomViewDialog<This>
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
Bekannte direkte Unterklassen:
CustomListDialog, SimpleCheckDialog, SimpleColorWheelDialog, SimpleDateDialog, SimpleFormDialog, SimpleImageDialog, SimpleInputDialog, SimplePinDialog, SimpleProgressDialog, SimpleTimeDialog

public abstract class CustomViewDialog<This extends CustomViewDialog<This>> extends SimpleDialog<This>
The base class for all custom dialogs. Extend this class and implement/overwrite the methods to use your custom view See SimpleCheckDialog as an example.

Created by eltos on 11.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
    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
     
    protected boolean
    callResultListener(int which, android.os.Bundle extras)
     
    final android.view.View
    extractContentView(android.os.Bundle savedInstanceState)
    Method to extract the underlying content view.
    protected final android.view.View
    inflate(int resource)
    Method to inflate your custom View from onCreateContentView(android.os.Bundle)
    protected final android.view.View
    inflate(int resource, android.view.ViewGroup root, boolean attachToRoot)
    Method to inflate your custom View from onCreateContentView(android.os.Bundle).
    void
    onCreate(android.os.Bundle savedInstanceState)
     
    protected abstract android.view.View
    onCreateContentView(android.os.Bundle savedInstanceState)
    Inflate your custom view here.
    android.app.Dialog
    onCreateDialog(android.os.Bundle savedInstanceState)
     
    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
    protected void
    Overwrite this method to modify what happens if the user presses the negative button.
    protected void
    Overwrite this method to modify what happens if the user presses the neutral button.
    protected void
    Overwrite this method to modify what happens if the user presses the positive button.
    protected 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)
    protected final void
    Simulates a positive button press.
    final void
    setNegativeButtonEnabled(boolean enabled)
    Call this method to enable or disable the positive button, e.g. if you want to consider for preconditions to be fulfilled
    final void
    setNeutralButtonEnabled(boolean enabled)
    Call this method to enable or disable the neutral button, e.g. if you want to consider for preconditions to be fulfilled
    final void
    setPositiveButtonEnabled(boolean enabled)
    Call this method to enable or disable the positive button, e.g. if you want to consider for preconditions to be fulfilled

    Von Klasse geerbte Methoden androidx.fragment.app.DialogFragment

    dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, 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

    • CustomViewDialog

      public CustomViewDialog()
  • Methodendetails

    • build

      public static CustomViewDialog build()
    • onCreateContentView

      protected abstract android.view.View onCreateContentView(android.os.Bundle savedInstanceState)
      Inflate your custom view here.
      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.
    • onResult

      @Nullable protected 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)
      Parameter:
      which - see SimpleDialog.OnDialogResultListener
      Gibt zurück:
      the bundle to merge with the results or null
    • setPositiveButtonEnabled

      public final void setPositiveButtonEnabled(boolean enabled)
      Call this method to enable or disable the positive button, e.g. if you want to consider for preconditions to be fulfilled

      Note: call this in onDialogShown() rather than onCreateContentView(android.os.Bundle)

      Parameter:
      enabled - whether to en- or disable the button
    • setNeutralButtonEnabled

      public final void setNeutralButtonEnabled(boolean enabled)
      Call this method to enable or disable the neutral button, e.g. if you want to consider for preconditions to be fulfilled

      Note: call this in onDialogShown() rather than onCreateContentView(android.os.Bundle)

      Parameter:
      enabled - whether to en- or disable the button
    • setNegativeButtonEnabled

      public final void setNegativeButtonEnabled(boolean enabled)
      Call this method to enable or disable the positive button, e.g. if you want to consider for preconditions to be fulfilled

      Note: call this in onDialogShown() rather than onCreateContentView(android.os.Bundle)

      Parameter:
      enabled - whether to en- or disable the button
    • acceptsPositiveButtonPress

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

      Note: do not call pressPositiveButton() here!

      Gibt zurück:
      false to ignore the press, true to process normally
    • onDialogShown

      protected void onDialogShown()
      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
    • onPositiveButtonClick

      protected void onPositiveButtonClick()
      Overwrite this method to modify what happens if the user presses the positive button. The default implementation dismisses the dialog and calls the result listener.
    • onNegativeButtonClick

      protected void onNegativeButtonClick()
      Overwrite this method to modify what happens if the user presses the negative button. The default implementation dismisses the dialog and calls the result listener.
    • onNeutralButtonClick

      protected void onNeutralButtonClick()
      Overwrite this method to modify what happens if the user presses the neutral button. The default implementation dismisses the dialog and calls the result listener.
    • pressPositiveButton

      protected final void pressPositiveButton()
      Simulates a positive button press. You may use this method in combination with ImeOptions such as EditorInfo.IME_ACTION_DONE Note: do not call this method from acceptsPositiveButtonPress() !!!
    • inflate

      protected final android.view.View inflate(@LayoutRes int resource)
      Method to inflate your custom View from onCreateContentView(android.os.Bundle)
      Parameter:
      resource - The resource to be inflated
      Gibt zurück:
      The inflated view
    • inflate

      protected final android.view.View inflate(@LayoutRes int resource, android.view.ViewGroup root, boolean attachToRoot)
      Method to inflate your custom View from onCreateContentView(android.os.Bundle). Throws InflateException if there is an error.
      Parameter:
      resource - ID for an XML layout resource to load
      root - Optional view to be the parent of the generated hierarchy (if attachToRoot is true), or else simply an object that provides a set of LayoutParams values for root of the returned hierarchy (if attachToRoot is false.)
      attachToRoot - Whether the inflated hierarchy should be attached to the root parameter? If false, root is only used to create the correct subclass of LayoutParams for the root view in the XML.
      Gibt zurück:
      The root View of the inflated hierarchy. If root was supplied and attachToRoot is true, this is root; otherwise it is the root of the inflated XML file.
    • extractContentView

      public final android.view.View extractContentView(android.os.Bundle savedInstanceState)
      Method to extract the underlying content view.
      Parameter:
      savedInstanceState - The saved instance state
      Gibt zurück:
      the extracted view
    • onCreate

      @CallSuper public void onCreate(android.os.Bundle savedInstanceState)
      Setzt außer Kraft:
      onCreate in Klasse SimpleDialog<This extends CustomViewDialog<This>>
    • onCreateDialog

      @NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState)
      Setzt außer Kraft:
      onCreateDialog in Klasse SimpleDialog<This extends CustomViewDialog<This>>
    • callResultListener

      @CallSuper protected boolean callResultListener(int which, @Nullable android.os.Bundle extras)
      Setzt außer Kraft:
      callResultListener in Klasse SimpleDialog<This extends CustomViewDialog<This>>