ColorPickerDialog - OneUIProject/OneUI-Design-Library GitHub Wiki

de.dlyt.yanndroid.oneui.dialog.ClassicColorPickerDialog
de.dlyt.yanndroid.oneui.dialog.DetailedColorPickerDialog

There are two types of color pickers in this library, a simple one (ClassicColorPickerDialog) and a more advanced one (ClassicColorPickerDialog). Select the one which corresponds to your needs.

1.

ClassicColorPickerDialog

Create a new instance of the dialog.

public ClassicColorPickerDialog(Context context, OnColorSetListener listener)
public ClassicColorPickerDialog(Context context, OnColorSetListener listener, int currentColor)
public ClassicColorPickerDialog(Context context, OnColorSetListener listener, int[] recentColors)
public ClassicColorPickerDialog(Context context, OnColorSetListener listener, int currentColor, int[] recentColors)

listener: listener for when color is set
currentColor: choose the default color
recentColors: string array for starting recent colors

Methods

Returns the current ColorPicker widget instance.

public SeslColorPicker getColorPicker()

Set a new default color and add it to recent colors.

public void setNewColor(int newColor)

Enable color transparency seekbar.

public void setTransparencyControlEnabled(boolean enabled)

2.

DetailedColorPickerDialog

Create a new instance of the dialog.

public DetailedColorPickerDialog(Context context, OnColorSetListener listener)
public DetailedColorPickerDialog(Context context, OnColorSetListener listener, int currentColor)
public DetailedColorPickerDialog(Context context, OnColorSetListener listener, int[] recentColors)
public DetailedColorPickerDialog(Context context, OnColorSetListener onColorSetListener, int currentColor, int[] recentColors)
public DetailedColorPickerDialog(Context context, OnColorSetListener listener, int currentColor, int[] recentColors, boolean initOpacity)

listener: listener for when color is set
currentColor: choose the default color
recentColors: string array for starting recent colors
initOpacity: initializes color transparency seekbar, needed by setTransparencyControlEnabled`() to work

Methods

Returns the current ColorPicker widget instance.

public SeslColorPicker getColorPicker()

Disables color swatch and editable values.

public void setOnlySpectrumMode()

Set a new default color and add it to recent colors.

public void setNewColor(int newColor)

Enable color transparency seekbar.

public void setTransparencyControlEnabled(boolean enabled)