Fanilog
07/27/2021, 12:19 PMVM
07/27/2021, 12:24 PMallan.conda
07/27/2021, 2:28 PMFanilog
07/27/2021, 2:37 PMFanilog
07/27/2021, 2:37 PMImage(…)
(backed or not by Coil) the scroll is way betterallan.conda
07/27/2021, 2:38 PMFanilog
07/27/2021, 2:40 PMfun <T : Any> LazyListScope.lazyItems(
lazyPagingItems: LazyPagingItems<T>,
key: ((index: Int) -> Any)? = null,
itemContent: @Composable LazyItemScope.(index: Int, value: T?) -> Unit
) {
items(lazyPagingItems.itemCount, key) { index ->
itemContent(index, lazyPagingItems.getAsState(index).value)
}
}
I didn’t know that Rc02 introduced it. I’m gonna give a try with the one provided by Compose thenallan.conda
07/27/2021, 2:55 PMallan.conda
07/27/2021, 2:55 PMpublic fun <T : Any> LazyListScope.items(
items: LazyPagingItems<T>,
key: ((item: T) -> Any)? = null,
itemContent: @Composable LazyItemScope.(value: T?) -> Unit
) {
items(
count = items.itemCount,
key = if (key == null) null else { index ->
val item = items.peek(index)
if (item == null) {
PagingPlaceholderKey(index)
} else {
key(item)
}
}
) { index ->
itemContent(items[index])
}
}
Fanilog
07/27/2021, 3:08 PMallan.conda
07/27/2021, 3:11 PMFanilog
07/27/2021, 3:19 PM