Package eltos.simpledialogfragment.form
Klasse SimpleFormDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<SimpleFormDialog>
eltos.simpledialogfragment.CustomViewDialog<SimpleFormDialog>
eltos.simpledialogfragment.form.SimpleFormDialog
- 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
,SimpleDialog.OnDialogResultListener
public class SimpleFormDialog
extends CustomViewDialog<SimpleFormDialog>
implements SimpleDialog.OnDialogResultListener
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungclass
A Callback Class with useful methods used byFormElementViewHolder.setUpView(android.view.View, android.content.Context, android.os.Bundle, eltos.simpledialogfragment.form.SimpleFormDialog.DialogActions)
class
A Callback Class with useful methods used byFormElementViewHolder.focus(eltos.simpledialogfragment.form.SimpleFormDialog.FocusActions)
static interface
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
FelderModifizierer und TypFeldBeschreibungprotected static final String
protected static final String
protected static final String
static final String
Von Klasse geerbte Felder eltos.simpledialogfragment.SimpleDialog
BUNDLE, CANCELABLE, FULLSCREEN, HTML, ICON_RESOURCE, MESSAGE, NEGATIVE_BUTTON_TEXT, NEUTRAL_BUTTON_TEXT, POSITIVE_BUTTON_TEXT, THEME, TITLE
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
Von Schnittstelle geerbte Felder eltos.simpledialogfragment.SimpleDialog.OnDialogResultListener
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, CANCELED
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected boolean
Overwrite this method to catch positive button presses, e.g. if you need to verify input by the userautofocus
(boolean enabled) En- or disables the automatic focussing of the first field in the form when the dialog opens.static SimpleFormDialog
build()
static SimpleFormDialog
buildEmailInput
(String emailFieldKey) Convenient method to build a form dialog with a single email inputstatic SimpleFormDialog
buildLogin
(String userFieldKey, String passwordFieldKey) Convenient method to build a form dialog with a plain input alongside a password input for login with username and passwordstatic SimpleFormDialog
buildLoginEmail
(String emailFieldKey, String passwordFieldKey) Convenient method to build a form dialog with an email input alongside a password input for login with email address and passwordstatic SimpleFormDialog
buildNumberInput
(String numberFieldKey) Convenient method to build a form dialog with a single number inputstatic SimpleFormDialog
buildPasswordInput
(String passwordFieldKey) Convenient method to build a form dialog with a single password inputstatic SimpleFormDialog
buildPinCodeInput
(String pinFieldKey) Convenient method to build a form dialog with a single pin code inputstatic SimpleFormDialog
buildPinCodeInput
(String pinFieldKey, int digits) Convenient method to build a form dialog with a single pin code inputfields
(FormElement... elements) Convenient method to populate the form with form elementsandroid.view.View
onCreateContentView
(android.os.Bundle savedInstanceState) Method for view creation.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 positiveButtonStateandroid.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)
boolean
Let the hosting fragment or activity implement this interface to receive results from the dialogvoid
onSaveInstanceState
(android.os.Bundle outState) protected String
onValidateInput
(String fieldKey, String input) protected void
populateContainer
(android.view.ViewGroup container, android.os.Bundle savedInstanceState) Creates FormElements and adds them to the containerprotected boolean
protected void
requestFocus
(int viewIndex) Von Klasse geerbte Methoden eltos.simpledialogfragment.CustomViewDialog
callResultListener, extractContentView, inflate, inflate, onCreate, onCreateDialog, onNegativeButtonClick, onNeutralButtonClick, onPositiveButtonClick, pressPositiveButton, setNegativeButtonEnabled, setNeutralButtonEnabled, setPositiveButtonEnabled
Von 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, title
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
-
Felddetails
-
TAG
- Siehe auch:
-
INPUT_FIELDS
- Siehe auch:
-
AUTO_FOCUS
- Siehe auch:
-
SAVE_TAG
- Siehe auch:
-
-
Konstruktordetails
-
SimpleFormDialog
public SimpleFormDialog()
-
-
Methodendetails
-
build
-
buildEmailInput
Convenient method to build a form dialog with a single email input- Parameter:
emailFieldKey
- the key that can be used to receive the entered text from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Gibt zurück:
- this instance
-
buildPasswordInput
Convenient method to build a form dialog with a single password input- Parameter:
passwordFieldKey
- the key that can be used to receive the entered text from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Gibt zurück:
- this instance
-
buildPinCodeInput
Convenient method to build a form dialog with a single pin code input- Parameter:
pinFieldKey
- the key that can be used to receive the entered text from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Gibt zurück:
- this instance
-
buildPinCodeInput
Convenient method to build a form dialog with a single pin code input- Parameter:
pinFieldKey
- the key that can be used to receive the entered text from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
digits
- the length of the pin code- Gibt zurück:
- this instance
-
buildNumberInput
Convenient method to build a form dialog with a single number input- Parameter:
numberFieldKey
- the key that can be used to receive the entered text from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Gibt zurück:
- this instance
-
buildLoginEmail
Convenient method to build a form dialog with an email input alongside a password input for login with email address and password- Parameter:
emailFieldKey
- the key that can be used to receive the entered email from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
passwordFieldKey
- the key that can be used to receive the entered password from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Gibt zurück:
- this instance
-
buildLogin
Convenient method to build a form dialog with a plain input alongside a password input for login with username and password- Parameter:
userFieldKey
- the key that can be used to receive the entered username from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
passwordFieldKey
- the key that can be used to receive the entered password from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Gibt zurück:
- this instance
-
fields
Convenient method to populate the form with form elements- Parameter:
elements
- theFormElement
s that form should contain- Gibt zurück:
- this instance
-
autofocus
En- or disables the automatic focussing of the first field in the form when the dialog opens. This is enabled by default.- Parameter:
enabled
- whether or not to autofocus the first field- Gibt zurück:
- this instance
-
onValidateInput
-
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 KlasseCustomViewDialog<SimpleFormDialog>
-
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 userNote: do not call
CustomViewDialog.pressPositiveButton()
here!- Setzt außer Kraft:
acceptsPositiveButtonPress
in KlasseCustomViewDialog<SimpleFormDialog>
- Gibt zurück:
- false to ignore the press, true to process normally
-
posButtonEnabled
protected boolean posButtonEnabled() -
requestFocus
protected void requestFocus(int viewIndex) -
onCreateContentView
public android.view.View onCreateContentView(android.os.Bundle savedInstanceState) Method for view creation. Inflates the layout and callspopulateContainer(ViewGroup, Bundle)
to populate the container with the fields specified- Angegeben von:
onCreateContentView
in KlasseCustomViewDialog<SimpleFormDialog>
- Parameter:
savedInstanceState
- The last saved instance state of the Fragment, or null if this fragment is created for the first time.- Gibt zurück:
- inflated view
-
populateContainer
protected void populateContainer(@NonNull android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) Creates FormElements and adds them to the container- Parameter:
container
- the container to hold the FormElementssavedInstanceState
- saved state
-
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 theSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Setzt außer Kraft:
onResult
in KlasseCustomViewDialog<SimpleFormDialog>
- Parameter:
which
- seeSimpleDialog.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 Klasseandroidx.fragment.app.DialogFragment
-
onResult
Beschreibung aus Schnittstelle kopiert:SimpleDialog.OnDialogResultListener
Let the hosting fragment or activity implement this interface to receive results from the dialog- Angegeben von:
onResult
in SchnittstelleSimpleDialog.OnDialogResultListener
- Parameter:
dialogTag
- the tag passed toSimpleDialog.show(androidx.fragment.app.Fragment)
which
- result type, one ofSimpleDialog.OnDialogResultListener.BUTTON_POSITIVE
,SimpleDialog.OnDialogResultListener.BUTTON_NEGATIVE
,SimpleDialog.OnDialogResultListener.BUTTON_NEUTRAL
orSimpleDialog.OnDialogResultListener.CANCELED
extras
- the extras passed toSimpleDialog.extra(Bundle)
- Gibt zurück:
- true if the result was handled, false otherwise
-