Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

ColorPickerDialog

Yanndroid edited this page Jan 30, 2022 · 3 revisions

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.

publicClassicColorPickerDialog(Contextcontext, OnColorSetListenerlistener)
publicClassicColorPickerDialog(Contextcontext, OnColorSetListenerlistener, intcurrentColor)
publicClassicColorPickerDialog(Contextcontext, OnColorSetListenerlistener, int[] recentColors)
publicClassicColorPickerDialog(Contextcontext, OnColorSetListenerlistener, intcurrentColor, 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.

publicSeslColorPickergetColorPicker()

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

publicvoidsetNewColor(intnewColor)

Enable color transparency seekbar.

publicvoidsetTransparencyControlEnabled(booleanenabled)

2.

DetailedColorPickerDialog

Create a new instance of the dialog.

publicDetailedColorPickerDialog(Contextcontext, OnColorSetListenerlistener)
publicDetailedColorPickerDialog(Contextcontext, OnColorSetListenerlistener, intcurrentColor)
publicDetailedColorPickerDialog(Contextcontext, OnColorSetListenerlistener, int[] recentColors)
publicDetailedColorPickerDialog(Contextcontext, OnColorSetListeneronColorSetListener, intcurrentColor, int[] recentColors)
publicDetailedColorPickerDialog(Contextcontext, OnColorSetListenerlistener, intcurrentColor, int[] recentColors, booleaninitOpacity)

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.

publicSeslColorPickergetColorPicker()

Disables color swatch and editable values.

publicvoidsetOnlySpectrumMode()

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

publicvoidsetNewColor(intnewColor)

Enable color transparency seekbar.

publicvoidsetTransparencyControlEnabled(booleanenabled)

Clone this wiki locally