ModifiersBuilders.Clickable


@RequiresSchemaVersion(major = 1, minor = 0)
public final class ModifiersBuilders.Clickable


A modifier for an element which can have associated Actions for click events. When an element with a ClickableModifier is clicked it will fire the associated action.

Summary

Nested types

Builder for Clickable

Public methods

@NonNull String

Gets the ID associated with this action.

@NonNull DimensionBuilders.DpProp

Gets the minimum height of the clickable area.

@NonNull DimensionBuilders.DpProp

Gets the minimum width of the clickable area.

@Nullable ActionBuilders.Action

Gets the action to perform when the element this modifier is attached to is clicked.

boolean

Gets whether the click visual feedback (such as a ripple) should be enabled.

@NonNull String

Public methods

getId

Added in 1.0.0
public @NonNull String getId()

Gets the ID associated with this action.

getMinimumClickableHeight

Added in 1.1.0
public @NonNull DimensionBuilders.DpProp getMinimumClickableHeight()

Gets the minimum height of the clickable area.

The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable height is not guaranteed unless there is enough space around the element within its parent bounds.

getMinimumClickableWidth

Added in 1.1.0
public @NonNull DimensionBuilders.DpProp getMinimumClickableWidth()

Gets the minimum width of the clickable area.

The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable width is not guaranteed unless there is enough space around the element within its parent bounds.

getOnClick

Added in 1.0.0
public @Nullable ActionBuilders.Action getOnClick()

Gets the action to perform when the element this modifier is attached to is clicked.

isVisualFeedbackEnabled

Added in 1.2.0
public boolean isVisualFeedbackEnabled()

Gets whether the click visual feedback (such as a ripple) should be enabled. Defaults to true.

toString

public @NonNull String toString()