Mark
09/12/2025, 8:24 AMFlowRow
that shows a bunch of tags (Chips). I was expecting this to be typically less than a hundred items, but I notice some users have over 500, and this causes major performance issues. How do you deal with `FlowRow`s with too many items?s3rius
09/12/2025, 8:55 AMMark
09/12/2025, 8:59 AMSergey Y.
09/12/2025, 8:59 AMMark
09/12/2025, 9:02 AMSergey Y.
09/12/2025, 9:04 AMMark
09/12/2025, 9:05 AMGuillaume B
09/12/2025, 9:21 AMSeri
09/12/2025, 3:02 PMSeri
09/12/2025, 3:03 PMContextualFlowRow
can be implemented fully in userspaceSeri
09/12/2025, 3:03 PMMark
09/12/2025, 5:10 PMFlowRow
call and it usually shows 1
. Should I also be trying this with each item?
val recompositionCount = remember { mutableIntStateOf(0) }
LaunchedEffect(Unit) {
recompositionCount.value++
}
Text("Recompositions: ${recompositionCount.value}")
Mark
09/12/2025, 5:49 PMText
composable, the rendering time comes down to about 900ms. So a big improvement. Claude suggests I use this, so I’m currently playing around with it to see if I can make it look the same. Note: I need the chip to be long-clickable.
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun FastChipText(
label: String,
onClick: () -> Unit,
onLongClick: () -> Unit,
modifier: Modifier = Modifier
) {
Text(
text = label,
modifier = modifier
.background(
color = MaterialTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(percent = 50),
)
.padding(horizontal = 12.dp, vertical = 6.dp)
.combinedClickable(
onClick = onClick,
onLongClick = onLongClick
),
style = MaterialTheme.typography.labelMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
Guillaume B
09/15/2025, 7:18 AM