-
-
Notifications
You must be signed in to change notification settings - Fork 18
SimpleColorDialog
Philipp Niedermayer edited this page Jun 12, 2021
·
5 revisions
extends CustomListDialog, Full API reference
A Dialog that can be used to choose a color from a pallet. Also allows for custom colors using the ColorWheelDialog
SimpleColorDialog.build()
.title(R.string.pick_a_color)
.colorPreset(color)
.allowCustom(true)
.show(this, COLOR_DIALOG);-
Color pallet
.colors(Context context, @ArrayRes int colorArrayRes)
.colors(@ColorInt int[] colors)
Predefined pallets to be used ascolorArrayRes:
@ArrayRes int SimpleColorDialog.MATERIAL_COLOR_PALLET(default if unspecified)
@ArrayRes int SimpleColorDialog.MATERIAL_COLOR_PALLET_LIGHT
@ArrayRes int SimpleColorDialog.MATERIAL_COLOR_PALLET_DARK
@ArrayRes int SimpleColorDialog.BEIGE_COLOR_PALLET
@ArrayRes int SimpleColorDialog.COLORFUL_COLOR_PALLET -
Initial selected color
.colorPreset(@ColorInt int color) -
Allow custom
.allowCustom(boolean allow).setupColorWheel*various methods to configure the color wheel dialog shown when the user clicks the "custom" palette icon, see javadoc -
Style
.showOutline(@ColorInt int color) -
Multi select
.choiceMode(SimpleColorDialog.MULTI_CHOICE)(derived from CustomListDialog)
See Receiving results from SimpleDialog.
The extras Bundle returned will contain the following keys:
@ColorInt int color = extras.getInt(SimpleColorDialog.COLOR); // The color chosen
int[] colors = extras.getIntArray(SimpleColorDialog.COLORS); // the colors chosen if multi select was enabledJavadoc API
Screenshot gallery
Styling dialogs with themes
Fullscreen dialogs
SimpleDialog
CustomViewDialog
CustomListDialog
SimpleCheckDialog
SimpleColorDialog
SimpleColorWheelDialog
SimpleDateDialog
SimpleEMailDialog
SimpleFormDialog
SimpleImageDialog
SimpleInputDialog
SimpleListDialog
SimplePinDialog
SimpleProgressDialog
SimpleTimeDialog