public class

ColorPickerInspectorView

extends FrameLayout
implements PropertyInspectorView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.ui.inspector.views.ColorPickerInspectorView

Class Overview

Inspector component for picking colors.

Summary

Nested Classes
interface ColorPickerInspectorView.ColorPickerDetailView Interface implemented by the different color picker detail views. 
interface ColorPickerInspectorView.ColorPickerListener Listener for color changes. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ColorPickerInspectorView(Context context, String label, int[] colors, int defaultValue, ColorPickerInspectorView.ColorPickerListener listener)
Construct color picker.
ColorPickerInspectorView(Context context, String label, List<Integer> colors, int defaultValue, ColorPickerInspectorView.ColorPickerListener listener)
Construct color picker.
ColorPickerInspectorView(Context context, String label, List<Integer> colors, int defaultValue, ColorPickerInspectorView.ColorPickerDetailView colorPickerDetailView, ColorPickerInspectorView.ColorPickerListener listener)
Construct color picker.
Public Methods
void bindController(PropertyInspectorController controller)
Bind to property inspector controller.
int getPropertyInspectorMaxHeight()
Returns maximum height that this view with all its detail views will occupy.
int getPropertyInspectorMinHeight()
Height of the parent PropertyInspector that this view would like it to have.
int getSuggestedHeight()
Returns best height of this view when shown in inspector.
View getView()
Casts the inspector view to the View class and returns it.
boolean isViewStateRestorationEnabled()
Flag to determine whether to save the state by calling on the view the saveHierarchyState(SparseArray) to save its state and restoreHierarchyState(SparseArray) to restore it.
void setColor(int color, boolean notifyListeners)
Sets value to the color picker.
void setColorPickerDetailView(ColorPickerInspectorView.ColorPickerDetailView colorPickerDetailView)
Sets the detail view that will be displayed when clicking on this color picker inspector.
void unbindController()
Unbind from property inspector controller.
Protected Methods
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void onRestoreInstanceState(Parcelable state)
Parcelable onSaveInstanceState()
[Expand]
Inherited Methods
From class android.widget.FrameLayout
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
From interface com.pspdfkit.ui.inspector.PropertyInspectorView

Public Constructors

public ColorPickerInspectorView (Context context, String label, int[] colors, int defaultValue, ColorPickerInspectorView.ColorPickerListener listener)

Construct color picker.

Parameters
context The context to use.
label Label displayed before slider view.
colors Available drawing colors.
defaultValue Default displayed color.
listener Listener for color picker changes.

public ColorPickerInspectorView (Context context, String label, List<Integer> colors, int defaultValue, ColorPickerInspectorView.ColorPickerListener listener)

Construct color picker.

Parameters
context The context to use.
label Label displayed before slider view.
colors Available drawing colors.
defaultValue Default displayed color.
listener Listener for color picker changes.

public ColorPickerInspectorView (Context context, String label, List<Integer> colors, int defaultValue, ColorPickerInspectorView.ColorPickerDetailView colorPickerDetailView, ColorPickerInspectorView.ColorPickerListener listener)

Construct color picker.

Parameters
context The context to use.
label Label displayed before slider view.
colors Available drawing colors.
defaultValue Default displayed color.
colorPickerDetailView The detail view to use, or null to use the default detail view.
listener Listener for color picker changes.

Public Methods

public void bindController (PropertyInspectorController controller)

Bind to property inspector controller.

public int getPropertyInspectorMaxHeight ()

Returns maximum height that this view with all its detail views will occupy.

Returns
  • Hint for the maximum inspector height or 0 if no max height is specified.

public int getPropertyInspectorMinHeight ()

Height of the parent PropertyInspector that this view would like it to have.

Returns
  • Hint for the minimum inspector height or 0 if no min height is specified.

public int getSuggestedHeight ()

Returns best height of this view when shown in inspector. This is used to suggest initial height to inspector parent.

Returns
  • Hint for the view height after being shown in inspector.

public View getView ()

Casts the inspector view to the View class and returns it.

public boolean isViewStateRestorationEnabled ()

Flag to determine whether to save the state by calling on the view the saveHierarchyState(SparseArray) to save its state and restoreHierarchyState(SparseArray) to restore it. Defaults to false. When enabled, the view must implement View#onSaveInstanceState and View#onRestoreInstanceState, and a unique id must be set by setId(int).

public void setColor (int color, boolean notifyListeners)

Sets value to the color picker.

public void setColorPickerDetailView (ColorPickerInspectorView.ColorPickerDetailView colorPickerDetailView)

Sets the detail view that will be displayed when clicking on this color picker inspector.

Parameters
colorPickerDetailView A ColorPickerInspectorView.ColorPickerDetailView to display when clicking on this color picker inspector.

public void unbindController ()

Unbind from property inspector controller.

Protected Methods

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected void onRestoreInstanceState (Parcelable state)

protected Parcelable onSaveInstanceState ()