Klasse ColorField

java.lang.Object
eltos.simpledialogfragment.form.FormElement<ColorField,eltos.simpledialogfragment.form.ColorViewHolder>
eltos.simpledialogfragment.form.ColorField
Alle implementierten Schnittstellen:
android.os.Parcelable

public class ColorField extends FormElement<ColorField,eltos.simpledialogfragment.form.ColorViewHolder>
A color element to be used with SimpleFormDialog One can pick a color here

This will add a ColorInt to resource bundle containing the color.

Created by eltos on 06.07.18

  • Felddetails

    • NONE

      @ColorInt public static final int NONE
      Siehe auch:
    • AUTO

      @ColorInt public static final int AUTO
      Siehe auch:
    • colors

      protected int[] colors
    • colorNames

      protected String[] colorNames
    • allowCustom

      protected boolean allowCustom
    • outline

      protected int outline
    • CREATOR

      public static final android.os.Parcelable.Creator<ColorField> CREATOR
  • Konstruktordetails

    • ColorField

      protected ColorField(android.os.Parcel in)
  • Methodendetails

    • picker

      public static ColorField picker(String key)
      Factory method for a color field.
      Parameter:
      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)
      Gibt zurück:
      this instance
    • color

      public ColorField color(@ColorInt int preset)
      Sets the initial color
      Parameter:
      preset - initial state
      Gibt zurück:
      this instance
    • colorRes

      public ColorField colorRes(@ColorRes int presetResourceId)
      Sets the initial color
      Parameter:
      presetResourceId - initial color as resource
      Gibt zurück:
      this instance
    • colors

      public ColorField colors(@ColorInt int[] colors)
      Sets the colors to choose from Default is the SimpleColorDialog.DEFAULT_COLORS set
      Parameter:
      colors - array of rgb-colors
      Gibt zurück:
      this instance
    • colorNames

      public ColorField colorNames(String[] colorNames)
      Sets the color names for accessibility purpose
      Parameter:
      colorNames - array of names that match the colors defined via colors(int[])
      Gibt zurück:
      this instance
    • colorNames

      public ColorField colorNames(android.content.Context context, @ArrayRes int colorNameArrayRes)
      Sets the color names for accessibility purpose
      Parameter:
      context - a context to resolve the resource
      colorNameArrayRes - String array resource id
      Gibt zurück:
      this instance
    • colors

      public ColorField colors(android.content.Context context, @ArrayRes int colorArrayRes)
      Parameter:
      context - a context to resolve the resource
      colorArrayRes - color array resource id
      Gibt zurück:
      this instance
    • allowCustom

      public ColorField allowCustom(boolean allow)
      Set this to true to show a field with a color picker option
      Parameter:
      allow - allow custom picked color if true
      Gibt zurück:
      this instance
    • showOutline

      public ColorField showOutline(@ColorInt int color)
      Add a colored outline to the color fields. NONE disables the outline (default) AUTO uses a black or white outline depending on the brightness
      Parameter:
      color - color int or NONE or AUTO
      Gibt zurück:
      this instance
    • buildViewHolder

      public eltos.simpledialogfragment.form.ColorViewHolder buildViewHolder()
      Beschreibung aus Klasse kopiert: FormElement
      Return your custom implementation of FormElementViewHolder here
      Angegeben von:
      buildViewHolder in Klasse FormElement<ColorField,eltos.simpledialogfragment.form.ColorViewHolder>
      Gibt zurück:
      The view holder that can represent this form element
    • getInitialColor

      @ColorInt protected int getInitialColor(android.content.Context context)
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Angegeben von:
      writeToParcel in Schnittstelle android.os.Parcelable
      Setzt außer Kraft:
      writeToParcel in Klasse FormElement<ColorField,eltos.simpledialogfragment.form.ColorViewHolder>
    • describeContents

      public int describeContents()
      Angegeben von:
      describeContents in Schnittstelle android.os.Parcelable
      Setzt außer Kraft:
      describeContents in Klasse FormElement<ColorField,eltos.simpledialogfragment.form.ColorViewHolder>