nuhkoca
07/14/2022, 4:43 PMsubscribeAsState
to collect the list but whenever there is an update in any element in the list, all item gets recomposed over and over so I am having flickers in the UI. I also pass a key per element down to LazyList
val instruments by instrumentList.subscribeAsState(initial = emptyList())
GIF in the threadval instruments by instrumentList.subscribeAsState(initial = emptyList())
LazyColumn(
state = rememberLazyListState(),
modifier = Modifier.fillMaxSize()
) {
items(instruments, key = { it.isin }) {
Box(Modifier.animateItemPlacement()) {
InstrumentView(instrument = it)
}
}
}
@Composable
private fun InstrumentView(
instrument: PortfolioPositionsInstrumentData,
) {
TRListItemLargePortfolioMetric(
...
)
Zach Klippenstein (he/him) [MOD]
07/14/2022, 4:53 PMnuhkoca
07/16/2022, 12:52 PM