Package eltos.simpledialogfragment.input
Klasse SimpleInputDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<SimpleInputDialog>
eltos.simpledialogfragment.CustomViewDialog<SimpleInputDialog>
eltos.simpledialogfragment.input.SimpleInputDialog
- 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:
SimpleEMailDialog
An simple dialog with an input field. Supports suggestions, input validations and
max length options.
Results: TEXT String The entered text
Created by eltos on 14.10.2015.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon 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
FelderModifizierer und TypFeldBeschreibungprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final StringVon 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 userallowEmpty(boolean allow) Allow empty input.static SimpleInputDialogbuild()getText()hint(int hintResourceId) Sets the EditText's hintSets the EditText's hintinputType(int inputType) Sets the input type The default isInputType.TYPE_CLASS_TEXT.booleanmax(int maxLength) Sets a max limit to the EditText.android.view.ViewonCreateContentView(android.os.Bundle savedInstanceState) Inflate your custom view here.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 positiveButtonStateandroid.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)voidonSaveInstanceState(android.os.Bundle outState) protected StringonValidateInput(String input) voidHelper for opening the soft keyboardprotected booleansuggest(android.content.Context context, int[] stringResourceIds) Provide an array of suggestions to be shown while the user is typingProvide an array of suggestions to be shown while the user is typingtext(int textResourceId) Sets the EditText's initial textSets the EditText's initial textVon Klasse geerbte Methoden eltos.simpledialogfragment.CustomViewDialog
callResultListener, extractContentView, inflate, inflate, onCreate, onCreateDialog, onNegativeButtonClick, onNeutralButtonClick, onPositiveButtonClick, pressPositiveButton, setNegativeButtonEnabled, setNeutralButtonEnabled, setPositiveButtonEnabledVon 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, 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:
-
TEXT
- Siehe auch:
-
HINT
- Siehe auch:
-
INPUT_TYPE
- Siehe auch:
-
ALLOW_EMPTY
- Siehe auch:
-
MAX_LENGTH
- Siehe auch:
-
SUGGESTIONS
- Siehe auch:
-
-
Konstruktordetails
-
SimpleInputDialog
public SimpleInputDialog()
-
-
Methodendetails
-
build
-
hint
Sets the EditText's hint- Parameter:
hint- the hint as string- Gibt zurück:
- this instance
-
hint
Sets the EditText's hint- Parameter:
hintResourceId- the hint as android string resource- Gibt zurück:
- this instance
-
text
Sets the EditText's initial text- Parameter:
text- initial text as string- Gibt zurück:
- this instance
-
text
Sets the EditText's initial text- Parameter:
textResourceId- initial text as android string resource- Gibt zurück:
- this instance
-
inputType
Sets the input type The default isInputType.TYPE_CLASS_TEXT.- Parameter:
inputType- the InputType- Gibt zurück:
- this instance
-
allowEmpty
Allow empty input. Default is to disable the positive button until text is entered.- Parameter:
allow- whether to allow empty input- Gibt zurück:
- this instance
-
max
Sets a max limit to the EditText.- Parameter:
maxLength- the maximum text length- Gibt zurück:
- this instance
-
suggest
Provide an array of suggestions to be shown while the user is typing- Parameter:
context- a context to resolve the resource idsstringResourceIds- suggestion array as android string resources- Gibt zurück:
- this instance
-
suggest
Provide an array of suggestions to be shown while the user is typing- Parameter:
strings- suggestion string array- Gibt zurück:
- this instance
-
onValidateInput
-
getText
- Gibt zurück:
- the current text or null
-
isInputEmpty
public boolean isInputEmpty() -
openKeyboard
public void openKeyboard()Helper for opening the soft keyboard -
onCreateContentView
public android.view.View onCreateContentView(android.os.Bundle savedInstanceState) Beschreibung aus Klasse kopiert:CustomViewDialogInflate your custom view here.- Angegeben von:
onCreateContentViewin KlasseCustomViewDialog<SimpleInputDialog>- 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:CustomViewDialogOverwrite 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:
onDialogShownin KlasseCustomViewDialog<SimpleInputDialog>
-
acceptsPositiveButtonPress
protected boolean acceptsPositiveButtonPress()Beschreibung aus Klasse kopiert:CustomViewDialogOverwrite 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:
acceptsPositiveButtonPressin KlasseCustomViewDialog<SimpleInputDialog>- Gibt zurück:
- false to ignore the press, true to process normally
-
onResult
public android.os.Bundle onResult(int which) Beschreibung aus Klasse kopiert:CustomViewDialogOverwrite 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:
onResultin KlasseCustomViewDialog<SimpleInputDialog>- 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:
onSaveInstanceStatein Klasseandroidx.fragment.app.DialogFragment
-