Class ColorPickerInspectorView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,com.pspdfkit.ui.inspector.PropertyInspectorView
public class ColorPickerInspectorView extends FrameLayout implements PropertyInspectorView
Inspector component for picking colors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ColorPickerInspectorView.ColorPickerListener
Listener for color changes.
public interface
ColorPickerInspectorView.ColorPickerDetailView
Interface implemented by the different color picker detail views.
-
Constructor Summary
Constructors Constructor Description ColorPickerInspectorView(Context context, String label, Array<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.
-
Method Summary
Modifier and Type Method Description void
setColorPickerDetailView(@NonNull() ColorPickerInspectorView.ColorPickerDetailView colorPickerDetailView)
Sets the detail view that will be displayed when clicking on this color picker inspector. void
setColor(@ColorInt() int color, boolean notifyListeners)
Sets value to the color picker. View
getView()
Casts the inspector view to the View class and returns it. void
bindController(@NonNull() PropertyInspectorController controller)
Bind to property inspector controller. void
unbindController()
Unbind from property inspector controller. int
getPropertyInspectorMinHeight()
Height of the parent PropertyInspector that this view would like it to have. int
getPropertyInspectorMaxHeight()
Returns maximum height that this view with all its detail views will occupy. int
getSuggestedHeight()
Returns best height of this view when shown in inspector. boolean
isViewStateRestorationEnabled()
Flag to determine whether to save the state by calling on the view the saveHierarchyState to save its state and restoreHierarchyState to restore it. -
-
Constructor Detail
-
ColorPickerInspectorView
ColorPickerInspectorView(Context context, String label, Array<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.
-
ColorPickerInspectorView
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.
-
ColorPickerInspectorView
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, ornull
to use the default detail view.listener
- Listener for color picker changes.
-
-
Method Detail
-
setColorPickerDetailView
void setColorPickerDetailView(@NonNull() ColorPickerInspectorView.ColorPickerDetailView colorPickerDetailView)
Sets the detail view that will be displayed when clicking on this color picker inspector.
- Parameters:
colorPickerDetailView
- A ColorPickerDetailView to display when clicking on this color picker inspector.
-
setColor
void setColor(@ColorInt() int color, boolean notifyListeners)
Sets value to the color picker.
-
bindController
void bindController(@NonNull() PropertyInspectorController controller)
Bind to property inspector controller.
-
unbindController
void unbindController()
Unbind from property inspector controller.
-
getPropertyInspectorMinHeight
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.
-
getPropertyInspectorMaxHeight
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.
-
getSuggestedHeight
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.
-
isViewStateRestorationEnabled
boolean isViewStateRestorationEnabled()
Flag to determine whether to save the state by calling on the view the saveHierarchyState to save its state and restoreHierarchyState to restore it. Defaults to
false
. When enabled, the view must implementView#onSaveInstanceState
andView#onRestoreInstanceState
, and a unique id must be set by setId.
-
-
-
-