public class ColorPickerView
extends View
Modifier and Type | Class and Description |
---|---|
static interface |
ColorPickerView.OnColorChangedListener |
Constructor and Description |
---|
ColorPickerView(Context context) |
ColorPickerView(Context context,
AttributeSet attrs) |
ColorPickerView(Context context,
AttributeSet attrs,
int defStyle) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlphaSliderText()
Get the current value of the text
that will be shown in the alpha
slider.
|
int |
getBorderColor()
Get the color of the border surrounding all panels.
|
int |
getColor()
Get the current color this view is showing.
|
float |
getDrawingOffset()
Get the drawing offset of the color picker view.
|
int |
getSliderTrackerColor() |
boolean |
onTouchEvent(MotionEvent event) |
boolean |
onTrackballEvent(MotionEvent event) |
void |
setAlphaSliderText(int res)
Set the text that should be shown in the
alpha slider.
|
void |
setAlphaSliderText(java.lang.String text)
Set the text that should be shown in the
alpha slider.
|
void |
setAlphaSliderVisible(boolean visible)
Set if the user is allowed to adjust the alpha panel.
|
void |
setBorderColor(int color)
Set the color of the border surrounding all panels.
|
void |
setColor(int color)
Set the color the view should show.
|
void |
setColor(int color,
boolean callback)
Set the color this view should show.
|
void |
setOnColorChangedListener(ColorPickerView.OnColorChangedListener listener)
Set a OnColorChangedListener to get notified when the color
selected by the user has changed.
|
void |
setSliderTrackerColor(int color) |
public ColorPickerView(Context context)
public ColorPickerView(Context context, AttributeSet attrs)
public ColorPickerView(Context context, AttributeSet attrs, int defStyle)
public boolean onTrackballEvent(MotionEvent event)
public boolean onTouchEvent(MotionEvent event)
public void setOnColorChangedListener(ColorPickerView.OnColorChangedListener listener)
listener
- public void setBorderColor(int color)
color
- public int getBorderColor()
public int getColor()
public void setColor(int color)
color
- The color that should be selected.public void setColor(int color, boolean callback)
color
- The color that should be selected.callback
- If you want to get a callback to
your OnColorChangedListener.public float getDrawingOffset()
public void setAlphaSliderVisible(boolean visible)
visible
- public void setSliderTrackerColor(int color)
public int getSliderTrackerColor()
public void setAlphaSliderText(int res)
res
- string resource id.public void setAlphaSliderText(java.lang.String text)
text
- Text that should be shown.public java.lang.String getAlphaSliderText()