mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
[demo-compose] Refactor modifier with better Kotlin syntax
PiperOrigin-RevId: 713476190
This commit is contained in:
parent
314413365b
commit
709d3fd35e
1 changed files with 7 additions and 10 deletions
|
|
@ -23,13 +23,10 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun Modifier.noRippleClickable(onClick: () -> Unit): Modifier {
|
internal fun Modifier.noRippleClickable(onClick: () -> Unit): Modifier =
|
||||||
return then(
|
|
||||||
clickable(
|
clickable(
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
indication = null, // to prevent the ripple from the tap
|
indication = null, // to prevent the ripple from the tap
|
||||||
) {
|
) {
|
||||||
onClick()
|
onClick()
|
||||||
}
|
}
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue