Vivek Rajendran
01/09/2024, 11:41 AMButton(
modifier = Modifier
.height(100.dp)
.width(300.dp)
.padding(16.dp),
onClick = {}
) {}
However, when you add verticalScroll(rememberScrollState()) to the button, only one recomposition happens for each click. Interestingly, if there is a delay between the press and release, one recomposition occurs for each (for a total of two recompositions). Why does this happen?
Button(
modifier = Modifier
.height(100.dp)
.width(300.dp)
.padding(16.dp)
.verticalScroll(rememberScrollState()),
onClick = {}
) {}
Louis Pullen-Freilich [G]
01/09/2024, 6:05 PMVivek Rajendran
01/10/2024, 5:56 AMText(
text = "Blah blah",
modifier = Modifier
.clickable(enabled = true, onClick = {})
)
However, it seems that the ripple effect is not causing recompositions. My understanding is that all UI changes should occur through recompositions. Is my understanding correct?Louis Pullen-Freilich [G]
01/10/2024, 11:48 AMVivek Rajendran
01/10/2024, 6:28 PM