nuhkoca
08/25/2022, 11:57 AMIf you are using LazyColumn/Row please make sure you provide a unique key for each item.
Did anybody face a similar problem with LazyList
?ste
08/25/2022, 12:51 PMnuhkoca
08/25/2022, 12:54 PMval instruments by viewModel.output.instruments.subscribeAsState(initial = emptyList())
and passing this list to LazyList as follow
LazyColumn(
state = rememberLazyListState(),
modifier = Modifier.fillMaxSize()
) {
...
items(
items = instruments,
key = { it.isin },
contentType = {
when {
it.derivativeTags?.optionTypeText != null -> CONTENT_TYPE_DERIVATIVES
it.hasSavingsPlan -> CONTENT_TYPE_SAVINGS_PLAN
sorting.criteria == Criteria.PositionSize -> CONTENT_TYPE_POSITION_SIZE
else -> CONTENT_TYPE_METRIC
}
}
) { item ->
...
}
}
ste
08/25/2022, 1:00 PMitem
which (mistakenly) has the same key of a `instrument`;
2. isin
is not unique. Is it complex object?nuhkoca
08/25/2022, 1:02 PMval instruments by viewModel.output.instruments.subscribeAsState(initial = emptyList())
this line might be suspicious? 🤔
isin
is an alphanumeric text like US14583249X
Chris Fillmore
08/25/2022, 6:04 PMisin
are unique (just for debugging purposes)
instruments.forEach { instrument ->
require(instruments.none { it.isin == instrument.isin })
}
Can you confirm all the isin
are unique?nuhkoca
08/25/2022, 8:21 PMXF000XRP0018
US88160R1014
US8676524064
US70450Y1038
US5949181045
XF000LTC0015
FR0000121014
JP3616200006
US30303M1027
XF000ETH0019
IE00BKM4GZ66
XF000LINK010
XF000BTC0017
XF000AVAX016
US0378331005
DE000TR04TT1
US02079K3059