Hatice Sarp
02/01/2021, 11:30 AMval paginatedBlockedUsers = settingsViewModel.fetchBlockedUsers().collectAsLazyPagingItems()
LazyColumn {
itemsIndexed(paginatedBlockedUsers) { index, item ->
if (item != null) {
UserListItem(
item = item
)
}
}
After upgrading from Alpha 9 to Alpha 11 when paging is on alpha-05, I get following error:
one of the following functions can be called with the arguments supplied:
public inline fun <T> LazyListScope.itemsIndexed(items: Array<TypeVariable(T)>, crossinline itemContent: LazyItemScope.(index: Int, item: TypeVariable(T)) -> Unit): Unit defined in androidx.compose.foundation.lazy
public inline fun <T> LazyListScope.itemsIndexed(items: List<TypeVariable(T)>, crossinline itemContent: LazyItemScope.(index: Int, item: TypeVariable(T)) -> Unit): Unit defined in androidx.compose.foundation.lazy
How do I use .collectAsLazyPagingItems() and itemsIndexed(paginatedItem) { index, item -> } in alpha 11 ?Cyril Find
02/01/2021, 12:01 PMimport androidx.compose.foundation.lazy.items
Hatice Sarp
02/01/2021, 12:43 PMimport androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.paging.LoadState
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.itemsIndexed
Cyril Find
02/01/2021, 12:45 PMHatice Sarp
02/01/2021, 2:10 PM