Jordi Saumell
01/29/2021, 9:55 PMJordi Saumell
01/29/2021, 9:55 PMif (index == selectedPosition) {
Text(
text = element,
modifier = Modifier
.align(Alignment.CenterVertically)
.background(Color(0xFFDDDDDD))
.border(1.dp, Color.Gray)
.clickable(onClick = { onClick(index) }/*FIXME , indication = null*/)
.padding(horizontal = 16.dp, vertical = 8.dp)
)
} else {
Text(
text = element,
modifier = Modifier
.align(Alignment.CenterVertically)
.clickable(onClick = { onClick(index) }/*FIXME , indication = null*/)
.padding(horizontal = 16.dp)
)
}
romainguy
01/29/2021, 9:56 PMJordi Saumell
01/29/2021, 9:56 PMJordi Saumell
01/29/2021, 9:58 PMAdam Powell
01/29/2021, 10:27 PMAdam Powell
01/29/2021, 10:27 PMgrandstaish
01/29/2021, 10:28 PMclickable
overload requires you pass both an indication
and an interactionState
Also it sounds like you’re just missing providing the ripple indication in your theme: e.g.: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]/kotlin/androidx/compose/material/MaterialTheme.kt;l=70;bpv=0matvei
02/01/2021, 11:05 AMnull
, then you want to pass down interactionState to this click to you could read interactionState.contains(Pressed)
later on reflect somewhere on UI that user is pressing.matvei
02/01/2021, 11:05 AMJordi Saumell
02/02/2021, 8:31 AM