Package eltos.simpledialogfragment.form
Class Check
java.lang.Object
eltos.simpledialogfragment.form.FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
eltos.simpledialogfragment.form.Check
- All Implemented Interfaces:
android.os.Parcelable
An checkbox form element to be used with
SimpleFormDialog
This is a CheckBox - what else?
This will add a Boolean to resource bundle containing the checked state.
Created by eltos on 21.02.17.-
Nested Class Summary
-
Field Summary
Fields inherited from class eltos.simpledialogfragment.form.FormElement
NO_ID, required, resultKey
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionstatic Check
Factory method for a check field.eltos.simpledialogfragment.form.CheckViewHolder
Return your custom implementation ofFormElementViewHolder
herecheck
(boolean preset) Sets the initial state of the checkboxcheck
(int preset) Sets the initial state of the checkboxint
protected boolean
getInitialState
(android.content.Context context) protected String
getText
(android.content.Context context) label
(int textResourceId) Sets the labelSets the labelvoid
writeToParcel
(android.os.Parcel dest, int flags) Methods inherited from class eltos.simpledialogfragment.form.FormElement
required, required
-
Field Details
-
CREATOR
-
-
Method Details
-
box
Factory method for a check field.- Parameters:
key
- the key that can be used to receive the final state from the bundle inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Returns:
- this instance
-
check
Sets the initial state of the checkbox- Parameters:
preset
- initial state- Returns:
- this instance
-
check
Sets the initial state of the checkbox- Parameters:
preset
- initial state as boolean resource- Returns:
- this instance
-
label
Sets the label- Overrides:
label
in classFormElement<Check,
eltos.simpledialogfragment.form.CheckViewHolder> - Parameters:
text
- label text as string- Returns:
- this instance
-
label
Sets the label- Overrides:
label
in classFormElement<Check,
eltos.simpledialogfragment.form.CheckViewHolder> - Parameters:
textResourceId
- label text as android string resource- Returns:
- this instance
-
buildViewHolder
public eltos.simpledialogfragment.form.CheckViewHolder buildViewHolder()Description copied from class:FormElement
Return your custom implementation ofFormElementViewHolder
here- Specified by:
buildViewHolder
in classFormElement<Check,
eltos.simpledialogfragment.form.CheckViewHolder> - Returns:
- The view holder that can represent this form element
-
getText
- Overrides:
getText
in classFormElement<Check,
eltos.simpledialogfragment.form.CheckViewHolder>
-
getInitialState
protected boolean getInitialState(android.content.Context context) -
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceandroid.os.Parcelable
- Overrides:
describeContents
in classFormElement<Check,
eltos.simpledialogfragment.form.CheckViewHolder>
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Overrides:
writeToParcel
in classFormElement<Check,
eltos.simpledialogfragment.form.CheckViewHolder>
-