ColorPickerInspectorDetailView

The single, unified detail view backing ColorPickerInspectorView. This is a Compose-backed reimplementation that replaces the two View classes the SDK used to ship — the old ColorPickerInspectorDetailView (a flat colour grid) and CustomColorPickerInspectorDetailView (palette + recents + variations + custom entry).

Which of those two behaviours you get is controlled by setRestrictToAvailableColors: the default false matches the old custom picker, while true matches the old flat grid by offering availableColors and nothing else.

Note that this class reuses the old flat-grid class's name but not its constructor contract: it takes no trailing singleLine flag, so calls to the old four-argument constructor fail to compile rather than changing behaviour silently.

Constructors

Link copied to clipboard
constructor(context: Context, availableColors: List<Int>, @ColorInt defaultColor: Int)

Properties

Link copied to clipboard
open override val maximumHeight: Int
Link copied to clipboard
open override val propertyInspectorMaxHeight: Int
Link copied to clipboard
open override val propertyInspectorMinHeight: Int
Link copied to clipboard
open override var state: Parcelable
Link copied to clipboard
open override val suggestedHeight: Int
Link copied to clipboard

Functions

Link copied to clipboard
open override fun bindController(controller: PropertyInspectorController)

Bind to property inspector controller.

Link copied to clipboard
open override fun getMaximumHeight(): Int

Called to get the maximum height the detail view will be.

Link copied to clipboard
open override fun getPropertyInspectorMaxHeight(): Int

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

Link copied to clipboard
open override fun getPropertyInspectorMinHeight(): Int

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

Link copied to clipboard
open override fun getState(): Parcelable

Called when it's time to save the view state. It will later be restored by calling setState ()}

Link copied to clipboard
open override fun getSuggestedHeight(): Int

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

Link copied to clipboard

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

Link copied to clipboard
open override fun onHidden()

Called when this inspector view was hidden.

Link copied to clipboard

Called to set the listener to notify once the user selected a color.

Link copied to clipboard
fun setRestrictToAvailableColors(restrictToAvailableColors: Boolean)

Restricts the user to availableColors when true, hiding the custom color entry, the recently used colors, and the generated color variations — every route to a color outside that list. Defaults to false.

Link copied to clipboard
fun setShowSelectionIndicator(showSelectionIndicator: Boolean)

Makes the color selection indicator visible/invisible, matching the legacy ColorPickerInspectorDetailView.setShowSelectionIndicator. Turn it off for pickers that apply a color to a target rather than representing a persistent selection.

Link copied to clipboard
open override fun setState(state: Parcelable)

Called to restore the state that was saved before by calling getState.

Link copied to clipboard
open override fun unbindController()

Unbind from property inspector controller.