public class

CustomColorPickerView

extends LinearLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.pdftron.pdf.controls.CustomColorPickerView

Class Overview

A Linear layout that shows recently selected colors, favorite colors

Summary

Nested Classes
interface CustomColorPickerView.OnEditFavoriteColorListener This interface is for listening events about editing favorite colors  
Constants
String KEY_FAVORITE_COLORS
String KEY_RECENT_COLORS
int MAX_COLORS
[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
CustomColorPickerView(Context context)
Class constructor
CustomColorPickerView(Context context, AttributeSet attrs)
Class constructor
CustomColorPickerView(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
Public Methods
void addRecentColorSource(String source)
Add color to recent color list
void deleteAllSelectedFavColors()
Delete all selected favorite colors
void editSelectedColor()
Open the edit favorite dialog.
ArrayList<String> getFavoriteColors()
Gets favorite colors
boolean onBackButonPressed()
If it is in edit favorite color mode, dismiss the edit favorite color mode
void saveColors()
Save favorite colors and recent colors to settings
void setActivity(FragmentActivity activity)
Sets activity.
void setColorsToFavorites(ArrayList<String> colors, int dialogMode)
Sets given colors to favorite colors
void setOnColorChangeListener(ColorPickerView.OnColorChangeListener listener)
Sets on color change listener
void setOnEditFavoriteColorlistener(CustomColorPickerView.OnEditFavoriteColorListener listener)
Sets on favorite color dialog listener
void setRecentColorLongPressListener(AdapterView.OnItemLongClickListener listener)
Sets recent color item long press listener
void setSelectedColor(String colorStr)
Sets selected color.
[Expand]
Inherited Methods
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Constants

public static final String KEY_FAVORITE_COLORS

Constant Value: "favorite_colors"

public static final String KEY_RECENT_COLORS

Constant Value: "recent_colors"

public static final int MAX_COLORS

Constant Value: 12 (0x0000000c)

Public Constructors

public CustomColorPickerView (Context context)

Class constructor

public CustomColorPickerView (Context context, AttributeSet attrs)

Class constructor

public CustomColorPickerView (Context context, AttributeSet attrs, int defStyleAttr)

Class constructor

Public Methods

public void addRecentColorSource (String source)

Add color to recent color list

Parameters
source the color in string format to be added to recent list

public void deleteAllSelectedFavColors ()

Delete all selected favorite colors

public void editSelectedColor ()

Open the edit favorite dialog.

public ArrayList<String> getFavoriteColors ()

Gets favorite colors

Returns
  • Favorite colors

public boolean onBackButonPressed ()

If it is in edit favorite color mode, dismiss the edit favorite color mode

public void saveColors ()

Save favorite colors and recent colors to settings

public void setActivity (FragmentActivity activity)

Sets activity. The activity is used to open add favorite dialog

Parameters
activity the activity

public void setColorsToFavorites (ArrayList<String> colors, int dialogMode)

Sets given colors to favorite colors

Parameters
colors The specified colors
dialogMode favorite mode. It must be one of ADD_COLOR or EDIT_COLOR

public void setOnColorChangeListener (ColorPickerView.OnColorChangeListener listener)

Sets on color change listener

Parameters
listener color change listener

public void setOnEditFavoriteColorlistener (CustomColorPickerView.OnEditFavoriteColorListener listener)

Sets on favorite color dialog listener

Parameters
listener The listener

public void setRecentColorLongPressListener (AdapterView.OnItemLongClickListener listener)

Sets recent color item long press listener

Parameters
listener The listener

public void setSelectedColor (String colorStr)

Sets selected color. If selected color matches any of the color grids, it will show a white check mark

Parameters
colorStr color in string format