Package eltos.simpledialogfragment
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.OnDialogResultListenerVon Klasse geerbte verschachtelte Klassen/Schnittstellen androidx.fragment.app.Fragment
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState -
Feldübersicht
FelderVon Klasse geerbte Felder eltos.simpledialogfragment.SimpleDialog
BUNDLE, CANCELABLE, FULLSCREEN, HTML, ICON_RESOURCE, MESSAGE, NEGATIVE_BUTTON_TEXT, NEUTRAL_BUTTON_TEXT, POSITIVE_BUTTON_TEXT, THEME, TITLEVon Klasse geerbte Felder androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMALVon Klasse geerbte Felder androidx.fragment.app.Fragment
mPreviousWho -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected booleanOverwrite this method to catch positive button presses, e.g. if you need to verify input by the userstatic CustomViewDialogbuild()protected booleancallResultListener(int which, android.os.Bundle extras) final android.view.ViewextractContentView(android.os.Bundle savedInstanceState) Method to extract the underlying content view.protected final android.view.Viewinflate(int resource) Method to inflate your custom View fromonCreateContentView(android.os.Bundle)protected final android.view.Viewinflate(int resource, android.view.ViewGroup root, boolean attachToRoot) Method to inflate your custom View fromonCreateContentView(android.os.Bundle).voidonCreate(android.os.Bundle savedInstanceState) protected abstract android.view.ViewonCreateContentView(android.os.Bundle savedInstanceState) Inflate your custom view here.android.app.DialogonCreateDialog(android.os.Bundle savedInstanceState) protected voidOverwrite this method to take action once the dialog is shown such as settings an input focus, showing the keyboard or setting the initial positiveButtonStateprotected voidOverwrite this method to modify what happens if the user presses the negative button.protected voidOverwrite this method to modify what happens if the user presses the neutral button.protected voidOverwrite this method to modify what happens if the user presses the positive button.protected android.os.BundleonResult(int which) Overwrite this method to provide additional results from your custom view to be passed to theSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)protected final voidSimulates a positive button press.final voidsetNegativeButtonEnabled(boolean enabled) Call this method to enable or disable the positive button, e.g. if you want to consider for preconditions to be fulfilledfinal voidsetNeutralButtonEnabled(boolean enabled) Call this method to enable or disable the neutral button, e.g. if you want to consider for preconditions to be fulfilledfinal voidsetPositiveButtonEnabled(boolean enabled) Call this method to enable or disable the positive button, e.g. if you want to consider for preconditions to be fulfilledVon Klasse geerbte Methoden eltos.simpledialogfragment.SimpleDialog
cancelable, extra, fullscreen, fullscreen, getArgs, getArgString, getContext, getExtras, getMessage, getTitle, icon, isCancelable, msg, msg, msgHtml, msgHtml, neg, neg, neg, neut, neut, neut, onCancel, onDestroyView, pos, pos, setArg, setArg, setArg, setArg, setButtonClickListener, setButtonEnabled, show, show, show, show, show, show, show, show, showKeyboard, theme, title, titleVon 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, showNowVon 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
-
Felddetails
-
TAG
- Siehe auch:
-
-
Konstruktordetails
-
CustomViewDialog
public CustomViewDialog()
-
-
Methodendetails
-
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 theSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)- Parameter:
which- seeSimpleDialog.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 fulfilledNote: call this in
onDialogShown()rather thanonCreateContentView(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 fulfilledNote: call this in
onDialogShown()rather thanonCreateContentView(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 fulfilledNote: call this in
onDialogShown()rather thanonCreateContentView(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 userNote: 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 asEditorInfo.IME_ACTION_DONENote: do not call this method fromacceptsPositiveButtonPress()!!! -
inflate
protected final android.view.View inflate(@LayoutRes int resource) Method to inflate your custom View fromonCreateContentView(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 fromonCreateContentView(android.os.Bundle). ThrowsInflateExceptionif there is an error.- Parameter:
resource- ID for an XML layout resource to loadroot- 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:
onCreatein KlasseSimpleDialog<This extends CustomViewDialog<This>>
-
onCreateDialog
@NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) - Setzt außer Kraft:
onCreateDialogin KlasseSimpleDialog<This extends CustomViewDialog<This>>
-
callResultListener
@CallSuper protected boolean callResultListener(int which, @Nullable android.os.Bundle extras) - Setzt außer Kraft:
callResultListenerin KlasseSimpleDialog<This extends CustomViewDialog<This>>
-