TheMrCodes
02/15/2021, 1:45 PM@Composable
fun MainContent() {
val data = (0 until 1000).map { "Item $it" }
LazyColumn(Modifier.fillMaxSize()) {
items(data) { text ->
Text(
text,
Modifier
.clickable { println("Element $text clicked!") }
.padding(14.dp)
.fillMaxWidth()
)
}
}
}
Cyril Find
02/15/2021, 1:49 PMremember
on data
because maybe doing a thousands times the map
operation on each compose is impacting performance ?TheMrCodes
02/15/2021, 1:52 PMdata
into a remember or collect it to a List (.toList()
)Igor Demin
02/15/2021, 1:52 PMTheMrCodes
02/15/2021, 1:54 PMIgor Demin
02/15/2021, 2:02 PMTimo Drick
02/15/2021, 2:06 PMTheMrCodes
02/15/2021, 2:08 PMIgor Demin
02/15/2021, 2:18 PMWhy do you not want to support mouse dragWe support mouse drag, just not for scrollable components. Scrollable components reacting to mouse drag look strange on desktop.
I think it emulates smooth scrolling by animating from one step to the next step.Yes, we want to implement smooth scrolling, but it is not in our priority.
just tested build149 and touch is not working at all for scrollingSo Microsoft Surface doesn't emulate scroll events 🤔. Good to know, thanks! True touch support isn't in our priority too, but we will eventually support this.
TheMrCodes
02/16/2021, 5:48 PM