public static final class ColorPickerDialog.Builder
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
ColorPickerDialog |
create()
Create the
ColorPickerDialog instance. |
ColorPickerDialog.Builder |
setAllowCustom(boolean allowCustom)
Show/Hide the neutral button to select a custom color.
|
ColorPickerDialog.Builder |
setAllowPresets(boolean allowPresets)
Show/Hide a neutral button to select preset colors.
|
ColorPickerDialog.Builder |
setColor(int color)
Set the original color
|
ColorPickerDialog.Builder |
setColorShape(int colorShape)
Set the shape of the color panel view.
|
ColorPickerDialog.Builder |
setCustomButtonText(int customButtonText)
Set the custom button text string resource id
|
ColorPickerDialog.Builder |
setDialogId(int dialogId)
Set the dialog id used for callbacks
|
ColorPickerDialog.Builder |
setDialogTitle(int dialogTitle)
Set the dialog title string resource id
|
ColorPickerDialog.Builder |
setDialogType(int dialogType)
Set which dialog view to show.
|
ColorPickerDialog.Builder |
setPresets(int[] presets)
Set the colors used for the presets
|
ColorPickerDialog.Builder |
setPresetsButtonText(int presetsButtonText)
Set the presets button text string resource id
|
ColorPickerDialog.Builder |
setSelectedButtonText(int selectedButtonText)
Set the selected button text string resource id
|
ColorPickerDialog.Builder |
setShowAlphaSlider(boolean showAlphaSlider)
Show the alpha slider
|
ColorPickerDialog.Builder |
setShowColorShades(boolean showColorShades)
Show/Hide the color shades in the presets picker
|
void |
show(FragmentActivity activity)
Create and show the
ColorPickerDialog created with this builder. |
public ColorPickerDialog.Builder setDialogTitle(int dialogTitle)
dialogTitle - The string resource used for the dialog titlepublic ColorPickerDialog.Builder setSelectedButtonText(int selectedButtonText)
selectedButtonText - The string resource used for the selected button textpublic ColorPickerDialog.Builder setPresetsButtonText(int presetsButtonText)
presetsButtonText - The string resource used for the presets button textpublic ColorPickerDialog.Builder setCustomButtonText(int customButtonText)
customButtonText - The string resource used for the custom button textpublic ColorPickerDialog.Builder setDialogType(int dialogType)
dialogType - Either ColorPickerDialog.TYPE_CUSTOM or ColorPickerDialog.TYPE_PRESETS.public ColorPickerDialog.Builder setPresets(int[] presets)
presets - An array of color ints.public ColorPickerDialog.Builder setColor(int color)
color - The default color for the color pickerpublic ColorPickerDialog.Builder setDialogId(int dialogId)
dialogId - The id that is sent back to the ColorPickerDialogListener.public ColorPickerDialog.Builder setShowAlphaSlider(boolean showAlphaSlider)
showAlphaSlider - true to show the alpha slider. Currently only supported with the ColorPickerView.public ColorPickerDialog.Builder setAllowPresets(boolean allowPresets)
allowPresets - false to disable showing the presets button.public ColorPickerDialog.Builder setAllowCustom(boolean allowCustom)
allowCustom - false to disable showing the custom button.public ColorPickerDialog.Builder setShowColorShades(boolean showColorShades)
showColorShades - false to hide the color shades.public ColorPickerDialog.Builder setColorShape(int colorShape)
colorShape - Either ColorShape.CIRCLE or ColorShape.SQUARE.public ColorPickerDialog create()
ColorPickerDialog instance.ColorPickerDialog.show(FragmentActivity)public void show(FragmentActivity activity)
ColorPickerDialog created with this builder.activity - The current activity.