You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When many images are loaded from the remote URL and displayed to LazyColumnForIndexed, there will be a stutter problem when sliding. A remote image loading component that I simply implemented by myself also has similar problems, but my implementation is implemented through onCommit().
running result:
my code:
@Composable
fun App(){
Surface(color = MaterialTheme.colors.background) {
LazyGridFor(items = getImages(), rowSize = 4) {
CoilImage(data = it)
}
}
}
@Composable
fun <T> LazyGridFor(
items: List<T>,
rowSize: Int = 1,
itemContent: @Composable BoxScope.(T) -> Unit
) {
val rows = items.chunked(rowSize)
LazyColumnForIndexed(rows) { index, row ->
Row(Modifier.fillParentMaxWidth(1f)) {
for ((index, item) in row.withIndex()) {
Box(Modifier.fillMaxWidth(1f / (rowSize - index))) {
itemContent(item)
}
}
}
}
}
Thank you for your contribution!👍
The text was updated successfully, but these errors were encountered:
Compose is in alpha so performance isn't expected to be perfect. If you find performance issues, please raise them on the Android bug tracker: https://issuetracker.google.com
When many images are loaded from the remote URL and displayed to LazyColumnForIndexed, there will be a stutter problem when sliding. A remote image loading component that I simply implemented by myself also has similar problems, but my implementation is implemented through onCommit().
running result:
my code:
Thank you for your contribution!👍
The text was updated successfully, but these errors were encountered: