Reputation: 61
Actual Result: Ripple effect triggered on scroll (Video)
Expected Result: Ripple effect is only triggered on click just like in Android Views
Code:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MyApp {
Content()
}
}
}
}
@Preview
@Composable
fun Content() {
val items = List(100) { "Item number $it" }
LazyColumn {
items(items = items) { item ->
Text(
text = item,
modifier = Modifier
.fillMaxWidth()
.clickable { }
.padding(16.dp)
)
}
}
}
Related issue tracker:
Upvotes: 5
Views: 573
Reputation: 278
You need to set options in your Modifier.clickable
like that :
Modifier.clickable(
interactionSource = MutableInteractionSource(),
indication = null,
onClick = {
/* Action */
}
)
Upvotes: 0