Package eltos.simpledialogfragment.form
Klasse FormElementViewHolder<E extends FormElement>
java.lang.Object
eltos.simpledialogfragment.form.FormElementViewHolder<E>
The Base class for all ViewHolders
This class is used to create the View that represents the corresponding FormElement
and to maintain it's functionality
Created by eltos on 23.02.17.
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract boolean
focus
(SimpleFormDialog.FocusActions actions) Method to focus this elementprotected abstract int
Implement this method to return a custom layout resource id for this viewprotected abstract boolean
posButtonEnabled
(android.content.Context context) Method to check for empty input, (un-)checked state etc.protected abstract void
putResults
(android.os.Bundle results, String key) Method to publish results from this view inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
protected abstract void
saveState
(android.os.Bundle outState) Method to save this elements state Bundles are maintained on a per-view basis, so that keys can be arbitraryprotected abstract void
setUpView
(android.view.View view, android.content.Context context, android.os.Bundle savedInstanceState, SimpleFormDialog.DialogActions actions) Implement this method to setup your view for the first time or after asaveState(android.os.Bundle)
protected abstract boolean
validate
(android.content.Context context) Method to validate input, state etc. and display an error message or indicator
-
Felddetails
-
field
The FormElement that this ViewHolder represents.
-
-
Konstruktordetails
-
FormElementViewHolder
-
-
Methodendetails
-
getContentViewLayout
@LayoutRes protected abstract int getContentViewLayout()Implement this method to return a custom layout resource id for this view- Gibt zurück:
- layout string resource
-
setUpView
protected abstract void setUpView(android.view.View view, android.content.Context context, android.os.Bundle savedInstanceState, SimpleFormDialog.DialogActions actions) Implement this method to setup your view for the first time or after asaveState(android.os.Bundle)
- Parameter:
view
- The view that was inflated using the layout fromgetContentViewLayout()
context
- The context of this viewsavedInstanceState
- A bundle containing everything that was saved insaveState(Bundle)
actions
- A callback for convenient methods. SeeSimpleFormDialog.DialogActions
-
saveState
protected abstract void saveState(android.os.Bundle outState) Method to save this elements state Bundles are maintained on a per-view basis, so that keys can be arbitrary- Parameter:
outState
- The bundle to save the state to
-
putResults
Method to publish results from this view inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Parameter:
results
- The bundle to save the results tokey
- The key that has to be used when storing results in the bundle
-
focus
Method to focus this element- Parameter:
actions
- An object providing useful callbacks, seeSimpleFormDialog.FocusActions
- Gibt zurück:
- Whether this view or one of its descendants actually took focus.
-
posButtonEnabled
protected abstract boolean posButtonEnabled(android.content.Context context) Method to check for empty input, (un-)checked state etc. Only simple (and fast) checks here, no error displaying! This is used only for single element forms.- Parameter:
context
- A context- Gibt zurück:
- true if positive button can be enabled
-
validate
protected abstract boolean validate(android.content.Context context) Method to validate input, state etc. and display an error message or indicator- Parameter:
context
- A context- Gibt zurück:
- true if the input, state etc. is valid, false otherwise
-