Class Check

java.lang.Object
eltos.simpledialogfragment.form.FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
eltos.simpledialogfragment.form.Check
All Implemented Interfaces:
android.os.Parcelable

public class Check extends FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
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.
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<Check> CREATOR
  • Method Details

    • box

      public static Check box(String key)
      Factory method for a check field.
      Parameters:
      key - the key that can be used to receive the final state from the bundle in SimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
      Returns:
      this instance
    • check

      public Check check(boolean preset)
      Sets the initial state of the checkbox
      Parameters:
      preset - initial state
      Returns:
      this instance
    • check

      public Check check(@BoolRes int preset)
      Sets the initial state of the checkbox
      Parameters:
      preset - initial state as boolean resource
      Returns:
      this instance
    • label

      public Check label(String text)
      Sets the label
      Overrides:
      label in class FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
      Parameters:
      text - label text as string
      Returns:
      this instance
    • label

      public Check label(@StringRes int textResourceId)
      Sets the label
      Overrides:
      label in class FormElement<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 of FormElementViewHolder here
      Specified by:
      buildViewHolder in class FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
      Returns:
      The view holder that can represent this form element
    • getText

      @Nullable protected String getText(android.content.Context context)
      Overrides:
      getText in class FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
    • getInitialState

      protected boolean getInitialState(android.content.Context context)
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
      Overrides:
      describeContents in class FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
      Overrides:
      writeToParcel in class FormElement<Check,eltos.simpledialogfragment.form.CheckViewHolder>