Package eltos.simpledialogfragment.form
Klasse Input
java.lang.Object
eltos.simpledialogfragment.form.FormElement<Input,eltos.simpledialogfragment.form.InputViewHolder>
eltos.simpledialogfragment.form.Input
- Alle implementierten Schnittstellen:
android.os.Parcelable
An input form element to be used with
SimpleFormDialog
This is an EditText that can be used to enter text, email-addresses, numbers, passwords etc.
Optionally supports auto-complete behaviour using suggestions.
This will add a String to resource bundle containing the entered text.
Created by eltos on 20.02.17.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen android.os.Parcelable
android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final android.os.Parcelable.Creator
<Input> protected int
protected Boolean
Von Klasse geerbte Felder eltos.simpledialogfragment.form.FormElement
NO_ID, required, resultKey
Von Schnittstelle geerbte Felder android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungasSpinner
(boolean spinner) Make this Input field a spinner (not editable, drop down button)eltos.simpledialogfragment.form.InputViewHolder
Return your custom implementation ofFormElementViewHolder
hereint
static Input
Factory method for an email input field.Shortcut forforceSuggestion(boolean)
forceSuggestion
(boolean force) Specify whether this input may contain only one of the suggestions provided.protected String
getHint
(android.content.Context context) protected String
getPatternError
(android.content.Context context) protected String[]
getSuggestions
(android.content.Context context) protected String
getText
(android.content.Context context) hint
(int hintResourceId) Sets a hintSets a hintinputType
(int inputType) Sets the input type The default isInputType.TYPE_CLASS_TEXT
.max
(int maxLength) Sets an upper limit to the input's text length.min
(int minLength) Sets a lower limit to the input's text length.Sets the input type toInputType.TYPE_TEXT_FLAG_MULTI_LINE
.multiLine
(int maxLines) Sets the input type toInputType.TYPE_TEXT_FLAG_MULTI_LINE
and the maximum number of lines to showstatic Input
Factory method for a name input field.static Input
Factory method for a password input field.static Input
Factory method for a phone input field.static Input
Factory method for a pin input field.static Input
Factory method for a plain input field.Displays a button to toggle the password visibility.showPasswordToggle
(boolean show) Hide or show a button to toggle the password visibility.static Input
Factory method for a spinner input field.static Input
static Input
static Input
static Input
suggest
(int suggestionArrayRes) Provide an array resource with suggestions to be shown while the user is typing.suggest
(int... suggestionStringResArray) Provide an array of suggestions to be shown while the user is typing This enables the auto-complete behaviour.Provide an array of suggestions to be shown while the user is typing This enables the auto-complete behaviour.Provide an array of suggestions to be shown while the user is typing This enables the auto-complete behaviour.text
(int textResourceId) Sets the initial textSets the initial textprotected String
validatePattern
(android.content.Context context, String input) validatePattern
(String pattern, int errorMsgId) Validate input using the supplied regular expression pattern and display an error message if the pattern does not match.validatePattern
(String pattern, String errorMsg) Validate input using the supplied regular expression pattern and display an error message if the pattern does not match.Validate input to consist of alpha-numeric characters only.Validate input as email address.Validate input so that only upper- and lowercase letters are contained.Validate input as password.wrap()
Enables wrapping of lines exceeding the width of the input field.wrap
(int maxLines) Enables wrapping of lines exceeding the width of the input field.Configures wrapping of lines exceeding the width of the input field.void
writeToParcel
(android.os.Parcel dest, int flags) Von Klasse geerbte Methoden eltos.simpledialogfragment.form.FormElement
label, label, required, required
-
Felddetails
-
wrap
-
maxLines
protected int maxLines -
CREATOR
-
-
Methodendetails
-
plain
Factory method for a plain input field.- Parameter:
key
- 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
-
name
Factory method for a name input field. InputType and hint are preset.- Parameter:
key
- 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
-
password
Factory method for a password input field. InputType and hint are preset. Shows a button to toggle the passwords visibility- Parameter:
key
- 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
-
pin
Factory method for a pin input field. InputType and hint are preset.- Parameter:
key
- 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
-
email
Factory method for an email input field. InputType and hint are preset. This field also validates, that an email matching the default pattern was entered.- Parameter:
key
- 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
-
phone
Factory method for a phone input field. InputType and hint are preset. This field also automatically format the phone number while the user is typing.- Parameter:
key
- 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
-
spinner
Factory method for a spinner input field. This disables editing and only uses suggestions.Make sure to supply the items via
suggest(int)
- Parameter:
key
- 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
-
spinner
-
spinner
-
spinner
-
spinner
-
hint
Sets a hint- Parameter:
hint
- the hint as string- Gibt zurück:
- this instance
-
hint
Sets a hint- Parameter:
hintResourceId
- the hint as android string resource- Gibt zurück:
- this instance
-
text
Sets the initial text- Parameter:
text
- initial text as string- Gibt zurück:
- this instance
-
text
Sets the 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 input type. SeeInputType
- Gibt zurück:
- this instance
-
multiLine
Sets the input type toInputType.TYPE_TEXT_FLAG_MULTI_LINE
.- Gibt zurück:
- this instance
-
multiLine
Sets the input type toInputType.TYPE_TEXT_FLAG_MULTI_LINE
and the maximum number of lines to show- Parameter:
maxLines
- the maximum number of lines to show. If the text exceeds this number of lines, the input field will scroll vertically.- Gibt zurück:
- this instance
-
wrap
Enables wrapping of lines exceeding the width of the input field.- Gibt zurück:
- this instance
-
wrap
Enables wrapping of lines exceeding the width of the input field.- Parameter:
maxLines
- the maximum number of lines to show. If the text exceeds this number of lines, the input field will scroll vertically.- Gibt zurück:
- this instance
-
wrap
Configures wrapping of lines exceeding the width of the input field.- Parameter:
wrap
- en-/disable wrapping of lines (and dis-/enable horizontal scrolling)maxLines
- the maximum number of lines to show. If the text exceeds this number of lines, the input field will scroll vertically.- Gibt zurück:
- this instance
-
showPasswordToggle
Displays a button to toggle the password visibility. Note that this will only work if the input type is a password. SeeshowPasswordToggle(boolean)
- Gibt zurück:
- this instance
-
showPasswordToggle
Hide or show a button to toggle the password visibility. Note that this will only work if the input type is a password.- Parameter:
show
- whether to show the password toggle button- Gibt zurück:
- this instance
-
max
Sets an upper limit to the input's text length.- Parameter:
maxLength
- the maximum text length- Gibt zurück:
- this instance
-
min
Sets a lower limit to the input's text length.- Parameter:
minLength
- the minimum text length- Gibt zurück:
- this instance
-
suggest
Provide an array resource with suggestions to be shown while the user is typing. This enables the auto-complete behaviour.- Parameter:
suggestionArrayRes
- the string array resource to suggest- Gibt zurück:
- this instance
-
suggest
Provide an array of suggestions to be shown while the user is typing This enables the auto-complete behaviour.- Parameter:
suggestionStringResArray
- array of string resources to suggest- Gibt zurück:
- this instance
-
suggest
Provide an array of suggestions to be shown while the user is typing This enables the auto-complete behaviour.- Parameter:
strings
- array of strings to suggest- Gibt zurück:
- this instance
-
suggest
Provide an array of suggestions to be shown while the user is typing This enables the auto-complete behaviour.- Parameter:
strings
- An ArrayList of strings to suggest- Gibt zurück:
- this instance
-
forceSuggestion
Shortcut forforceSuggestion(boolean)
- Gibt zurück:
- this instance
-
forceSuggestion
Specify whether this input may contain only one of the suggestions provided. If enabled, the EditText will show an error message if something else was entered. This will only take affect if suggestions were set by any of thesuggest(int)
methodsIf the suggestion array is small, consider using a spinner instead.
- Parameter:
force
- whether to force the input to be one of the suggestions or not- Gibt zurück:
- this instance
-
asSpinner
Make this Input field a spinner (not editable, drop down button)- Parameter:
spinner
- whether to make this a spinner- Gibt zurück:
- this instance
-
validatePattern
Validate input using the supplied regular expression pattern and display an error message if the pattern does not match.- Parameter:
pattern
- a regular expression used to validate inputerrorMsg
- the error message to display, if the pattern does not match the input- Gibt zurück:
- this instance
-
validatePattern
Validate input using the supplied regular expression pattern and display an error message if the pattern does not match. SeevalidatePattern(String, String)
- Parameter:
pattern
- a regular expression used to validate inputerrorMsgId
- the error message to display as string resource- Gibt zurück:
- this instance
-
validatePatternEmail
Validate input as email address. Shortcut forvalidatePattern(String, int)
.- Gibt zurück:
- this instance
-
validatePatternStrongPassword
Validate input as password. The password must consists of at least 8 chars and contains at least one number, one special character, one upper and one lower case letter Shortcut forvalidatePattern(String, int)
.- Gibt zurück:
- this instance
-
validatePatternLetters
Validate input so that only upper- and lowercase letters are contained. Shortcut forvalidatePattern(String, int)
.- Gibt zurück:
- this instance
-
validatePatternAlphanumeric
Validate input to consist of alpha-numeric characters only. Shortcut forvalidatePattern(String, int)
.- Gibt zurück:
- this instance
-
buildViewHolder
public eltos.simpledialogfragment.form.InputViewHolder buildViewHolder()Beschreibung aus Klasse kopiert:FormElement
Return your custom implementation ofFormElementViewHolder
here- Angegeben von:
buildViewHolder
in KlasseFormElement<Input,
eltos.simpledialogfragment.form.InputViewHolder> - Gibt zurück:
- The view holder that can represent this form element
-
validatePattern
-
getPatternError
-
getHint
-
getText
- Setzt außer Kraft:
getText
in KlasseFormElement<Input,
eltos.simpledialogfragment.form.InputViewHolder>
-
getSuggestions
-
describeContents
public int describeContents()- Angegeben von:
describeContents
in Schnittstelleandroid.os.Parcelable
- Setzt außer Kraft:
describeContents
in KlasseFormElement<Input,
eltos.simpledialogfragment.form.InputViewHolder>
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags) - Angegeben von:
writeToParcel
in Schnittstelleandroid.os.Parcelable
- Setzt außer Kraft:
writeToParcel
in KlasseFormElement<Input,
eltos.simpledialogfragment.form.InputViewHolder>
-