clickable
Functions summary
GlanceModifier |
@ComposableRun |
GlanceModifier |
@ComposableRun |
GlanceModifier |
@ComposableRun |
Functions
GlanceModifier.clickable
@Composable
fun GlanceModifier.clickable(block: () -> Unit): GlanceModifier
Run block in response to a user click.
The lambda provided to this function will use the androidx.compose.runtime.currentCompositeKeyHash to set a key for this lambda that will be used to trigger it when the corresponding UI element is clicked. Since that key is based on the location within the composition, it will be identical for lambdas generated in a loop (if not using androidx.compose.runtime.key).
To avoid this, prefer setting explicit keys for your lambdas, by using the overload of clickable that accepts a key parameter.
| Parameters | |
|---|---|
block: () -> Unit |
The action to run. |
GlanceModifier.clickable
@Composable
fun GlanceModifier.clickable(
rippleOverride: @DrawableRes Int = NoRippleOverride,
block: () -> Unit
): GlanceModifier
Run block in response to a user click.
The lambda provided to this function will use the androidx.compose.runtime.currentCompositeKeyHash to set a key for this lambda that will be used to trigger it when the corresponding UI element is clicked. Since that key is based on the location within the composition, it will be identical for lambdas generated in a loop (if not using androidx.compose.runtime.key).
To avoid this, prefer setting explicit keys for your lambdas, by using the overload of clickable that accepts a key parameter.
| Parameters | |
|---|---|
rippleOverride: @DrawableRes Int = NoRippleOverride |
A drawable resource to use as the onClick ripple. Use |
block: () -> Unit |
The action to run. |
GlanceModifier.clickable
@Composable
fun GlanceModifier.clickable(
key: String? = null,
rippleOverride: @DrawableRes Int = NoRippleOverride,
block: () -> Unit
): GlanceModifier
Run block in response to a user click.
| Parameters | |
|---|---|
key: String? = null |
A stable and unique key that identifies this action. This key is saved in the PendingIntent for the UI element, and used to trigger this action when the element is clicked. If not provided we use |
rippleOverride: @DrawableRes Int = NoRippleOverride |
A drawable resource to use as the onClick ripple. Use |
block: () -> Unit |
The action to run. |