Simon Stahl
05/12/2022, 8:04 PMLazyLists
are not called synchronously as the below exampel shows.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Log.e("Simon", "MainActivity.onCreate() ... start benchmark")
ComposeTestTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
LazyColumn {
items(100) {
Log.e("Simon", "MainActivity.onCreate() ... compose item $it")
Text(
modifier = Modifier.padding(10.dp),
text = "Item $it"
)
}
}
}
}
Log.e("Simon", "MainActivity.onCreate() ... stop benchmark")
}
}
Log output:
MainActivity.onCreate() ... start benchmark
MainActivity.onCreate() ... stop benchmark
MainActivity.onCreate() ... compose item 0
MainActivity.onCreate() ... compose item 1
...
Ben Trengrove [G]
05/12/2022, 9:37 PMSimon Stahl
05/12/2022, 10:50 PMBen Trengrove [G]
05/12/2022, 11:31 PMSimon Stahl
05/12/2022, 11:45 PM