public class ColorPickerDialog extends DialogFragment implements ColorPickerView.OnColorChangedListener, android.text.TextWatcher
A dialog to pick a color.
The activity that shows this dialog should implement ColorPickerDialogListener
Example usage:
ColorPickerDialog.newBuilder().show(activity);
| Modifier and Type | Class and Description |
|---|---|
static class |
ColorPickerDialog.Builder |
static interface |
ColorPickerDialog.DialogType |
| Modifier and Type | Field and Description |
|---|---|
static int[] |
MATERIAL_COLORS
Material design colors used as the default color presets
|
static int |
TYPE_CUSTOM |
static int |
TYPE_PRESETS |
| Constructor and Description |
|---|
ColorPickerDialog() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterTextChanged(android.text.Editable s) |
void |
beforeTextChanged(java.lang.CharSequence s,
int start,
int count,
int after) |
static ColorPickerDialog.Builder |
newBuilder()
Create a new Builder for creating a
ColorPickerDialog instance |
void |
onColorChanged(int newColor) |
android.app.Dialog |
onCreateDialog(android.os.Bundle savedInstanceState) |
void |
onDismiss(android.content.DialogInterface dialog) |
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
onStart() |
void |
onTextChanged(java.lang.CharSequence s,
int start,
int before,
int count) |
void |
setColorPickerDialogListener(ColorPickerDialogListener colorPickerDialogListener)
Set the callback.
|
public static final int TYPE_CUSTOM
public static final int TYPE_PRESETS
public static final int[] MATERIAL_COLORS
public static ColorPickerDialog.Builder newBuilder()
ColorPickerDialog instancebuilder to create the ColorPickerDialog.public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState)
public void onStart()
public void onDismiss(android.content.DialogInterface dialog)
public void onSaveInstanceState(android.os.Bundle outState)
public void setColorPickerDialogListener(ColorPickerDialogListener colorPickerDialogListener)
ColorPickerDialogListener as this will not survive an orientation change.colorPickerDialogListener - The callback invoked when a color is selected or the dialog is dismissed.public void onColorChanged(int newColor)
onColorChanged in interface ColorPickerView.OnColorChangedListenerpublic void beforeTextChanged(java.lang.CharSequence s,
int start,
int count,
int after)
beforeTextChanged in interface android.text.TextWatcherpublic void onTextChanged(java.lang.CharSequence s,
int start,
int before,
int count)
onTextChanged in interface android.text.TextWatcherpublic void afterTextChanged(android.text.Editable s)
afterTextChanged in interface android.text.TextWatcher