https://kotlinlang.org logo
#compose
Title
# compose
m

Mini

02/01/2023, 9:35 AM
I have a screen-level composable that used to take a list of items to display in a lazycolumn, but I have now the list with Paging3
LazyPagingItems<T>
, but now I wonder how to preview/screenshot test this composable as I cannot instantiate
LazyPagingItems
. What would be the best approach to solve this? One approach I can think of would be slotting the items composable, along the lines of
Copy code
items: LazyListScope.(@Composable (MyType) -> Unit) -> Unit,
and using
items<List>(myTestItems)
for tests and previews and using
items<LazyPagingItems<T>>(myPagedItems)
for real implementation. That does not feel great tho
For future readers; I did very poor research on this one. List => PagingData by using
Copy code
PagingData.from(myList)
4 Views