ModifiersBuilders.Clickable.Builder


public final class ModifiersBuilders.Clickable.Builder


Builder for Clickable

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull ModifiersBuilders.Clickable

Builds an instance from accumulated values.

@NonNull ModifiersBuilders.Clickable.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setId(@NonNull String id)

Sets the ID associated with this action.

@NonNull ModifiersBuilders.Clickable.Builder
@RequiresSchemaVersion(major = 1, minor = 300)
setMinimumClickableHeight(
    @NonNull DimensionBuilders.DpProp minimumClickableHeight
)

Sets the minimum height of the clickable area.

@NonNull ModifiersBuilders.Clickable.Builder
@RequiresSchemaVersion(major = 1, minor = 300)
setMinimumClickableWidth(
    @NonNull DimensionBuilders.DpProp minimumClickableWidth
)

Sets the minimum width of the clickable area.

@NonNull ModifiersBuilders.Clickable.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setOnClick(@NonNull ActionBuilders.Action onClick)

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

@NonNull ModifiersBuilders.Clickable.Builder
@RequiresSchemaVersion(major = 1, minor = 400)
setVisualFeedbackEnabled(boolean visualFeedbackEnabled)

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

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.0.0
public @NonNull ModifiersBuilders.Clickable build()

Builds an instance from accumulated values.

setId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Clickable.Builder setId(@NonNull String id)

Sets the ID associated with this action.

setMinimumClickableHeight

Added in 1.1.0
@RequiresSchemaVersion(major = 1, minor = 300)
public @NonNull ModifiersBuilders.Clickable.Builder setMinimumClickableHeight(
    @NonNull DimensionBuilders.DpProp minimumClickableHeight
)

Sets 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.

Note that this field only supports static values.

setMinimumClickableWidth

Added in 1.1.0
@RequiresSchemaVersion(major = 1, minor = 300)
public @NonNull ModifiersBuilders.Clickable.Builder setMinimumClickableWidth(
    @NonNull DimensionBuilders.DpProp minimumClickableWidth
)

Sets 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.

Note that this field only supports static values.

setOnClick

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Clickable.Builder setOnClick(@NonNull ActionBuilders.Action onClick)

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

setVisualFeedbackEnabled

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 400)
public @NonNull ModifiersBuilders.Clickable.Builder setVisualFeedbackEnabled(boolean visualFeedbackEnabled)

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