John O'Reilly
05/28/2021, 4:50 PM0.4.0-rc2
version (from 0.4.0-build189
) and now seeing what looks like change in recomposition behaviour...more in thread...John O'Reilly
05/28/2021, 4:50 PMJohn O'Reilly
05/28/2021, 4:51 PMvar selectedPerson by remember { mutableStateOf("") }
PersonList(peopleState, selectedPerson) {
selectedPerson = it.name
}
John O'Reilly
05/28/2021, 4:52 PMselectedPerson
was updated (after user selected in list) but doesn't seem to be any more
PersonDetailsView(selectedPerson)
John O'Reilly
05/28/2021, 4:53 PMjim
05/28/2021, 6:21 PMJohn O'Reilly
05/28/2021, 6:22 PMJohn O'Reilly
05/28/2021, 6:23 PMjim
05/28/2021, 6:24 PMpersonSelected : (person : Assignment) -> Unit
jim
05/28/2021, 6:24 PMjim
05/28/2021, 6:24 PMjim
05/28/2021, 6:27 PMselectedPerson
parameter so it doesn't end up in the trailing lambda positionjim
05/28/2021, 6:28 PMJohn O'Reilly
05/28/2021, 6:28 PMjim
05/28/2021, 6:29 PMJohn O'Reilly
05/28/2021, 6:29 PMjim
05/28/2021, 6:43 PMJohn O'Reilly
05/28/2021, 6:46 PMJohn O'Reilly
05/28/2021, 6:56 PMPersonDetailsView
- can't remember history of why that's exactly way that is but if I use say normal Column
there it works....
Here's a gist with failing code (with no other dependencies I think) https://gist.github.com/joreilly/4541a4245ca5964b391884dd2c9438a3John O'Reilly
05/28/2021, 7:01 PMJohn O'Reilly
05/28/2021, 7:06 PMPersonDetailsView
being invoked....could it be somehow related to some caching behaviour related to item
(just clutching at straws here!)John O'Reilly
05/28/2021, 7:11 PMitem
)
@Composable
fun PersonDetailsView(personName: String) {
LazyColumn(
modifier = Modifier.padding(16.dp).fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
item(personName) {
Text(personName, style = MaterialTheme.typography.h4)
}
}
}
John O'Reilly
05/28/2021, 7:25 PM