public class

ColorPickerAlertDialog

extends AlertDialog
java.lang.Object
   ↳ android.app.Dialog
     ↳ android.app.AlertDialog
       ↳ com.droidux.pack.commons.widget.color.ColorPickerAlertDialog

Class Overview

A subclass of AlertDialog for choosing color.

Summary

[Expand]
Inherited Constants
From class android.app.AlertDialog
From interface android.content.DialogInterface
Public Constructors
ColorPickerAlertDialog(Context context, int initialColor, ColorPickerInterfaces.Listeners.OnColorDialogListener listener)
Public Methods
int getColor()
Gets the currently selected color.
void setColor(int color)
Sets the currently selected color.
void setOnColorDialogListener(ColorPickerInterfaces.Listeners.OnColorDialogListener listener)
Registers a listener to be notified when events related to the color selection is fired.
void showAlphaPanel(boolean show)
Whether to show or hide the panel that allows the user to adjust the alpha value.
void showSelectionPanel(boolean show)
Whether to show or hide the panel that shows the original and currently selected color.
[Expand]
Inherited Methods
From class android.app.AlertDialog
From class android.app.Dialog
From class java.lang.Object
From interface android.content.DialogInterface
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback

Public Constructors

public ColorPickerAlertDialog (Context context, int initialColor, ColorPickerInterfaces.Listeners.OnColorDialogListener listener)

Since: API Level 2.5

Public Methods

public int getColor ()

Since: API Level 2.5

Gets the currently selected color.

Returns
  • The currently selected color.

public void setColor (int color)

Since: API Level 2.5

Sets the currently selected color.

Parameters
color The currently selected color.

public void setOnColorDialogListener (ColorPickerInterfaces.Listeners.OnColorDialogListener listener)

Since: API Level 2.5

Registers a listener to be notified when events related to the color selection is fired.

Parameters
listener The listener to be notified.

public void showAlphaPanel (boolean show)

Since: API Level 2.5

Whether to show or hide the panel that allows the user to adjust the alpha value.

Parameters
show If true, show the alpha panel, otherwise hide it.

public void showSelectionPanel (boolean show)

Since: API Level 2.5

Whether to show or hide the panel that shows the original and currently selected color. By default, and in most situation, you want to show this panel. But there might be cases where you want to hide this.

Parameters
show If true, show the selection panel, otherwise hide it.