Projects ColorPickerDialog Docs PickerView

init

Type: protected abstract void

Called by the constructor, used to initialize and inflate the child views of the picker layout.

postInit

Type: private void

Called after init(), used to set up child views that should be present inmostpickers, such as the "alpha" slider.

setColor

Type: public void

Set the picker's color. Changes to values will not be animated.

Parameter Name Description
color The picker's color.

setColor

Type: public void

Set the picker's color.

Parameter Name Description
color The picker's color.
animate Whether to animate changes in values.

getColor

Type: @ColorInt public abstract int

Get the current color value.

Returned Value: The current color value.

getName

Type: @NonNull public abstract String

Get the "name" of the type of picker view. For example, an RGBPickerView would return the string "RGB".

Returned Value: The "name" of the type of picker.

isTrackingTouch

Type: public boolean

Determine whether the view is currently tracking a touch interaction. This is useful for determining when the next color update will occur and deciding whether to animate a value change.

Returned Value: Whether the view is currently tracking a touch interaction.

setAlphaEnabled

Type: public void

Set whether the color's alpha value can be changed.

Parameter Name Description
isAlpha Whether the color's alpha value can be changed.

isAlphaEnabled

Type: public boolean

Determine whether the color's alpha value can be modified.

Returned Value: Whether the color's alpha value can be modified.

setColorAlpha

Type: public void

Set the color's alpha, from 0-255. Change in values will not be animated.

Parameter Name Description
alpha The color's alpha, from 0-255.

setColorAlpha

Type: public void

Set the color's alpha, between 0-1 (inclusive).

Parameter Name Description
alpha The color's alpha, between 0-1 (inclusive).
animate Whether to animate the change in values.

getColorAlpha

Type: public int

Gets the color's alpha, from 0-255.

Returned Value: The color's alpha, from 0-255.

setListener

Type: public void

Set an interface to receive updates to color values. This may be called multiple times in succession if a slider is dragged or animated; be wary of performance.

Parameter Name Description
listener An interface to receive color updates.

withActivityRequestHandler

Type: public PickerView

Set a permissions handler interface for this view to use for permission requests.

Parameter Name Description
requestHandler The interface to pass permission requests to.

Returned Value: "This" view instance, for method chaining.

hasActivityRequestHandler

Type: public boolean

Determine whether the PickerView currently has a request handler.

Returned Value: True if the view has a request handler.