Merge branch 'feature/bma/optimizeLazyColumn' into develop

This commit is contained in:
Benoit Marty 2022-11-23 18:08:44 +01:00
commit cddd039156
3 changed files with 32 additions and 3 deletions

View file

@ -122,7 +122,10 @@ fun RoomListContent(
.nestedScroll(nestedScrollConnection),
state = lazyListState,
) {
items(roomSummaries) { room ->
items(
items = roomSummaries,
contentType = { room -> room.contentType() },
) { room ->
RoomSummaryRow(room = room, onClick = ::onRoomClicked)
}
}
@ -134,6 +137,8 @@ fun RoomListContent(
}
}
private fun RoomListRoomSummary.contentType() = isPlaceholder
private fun LazyListState.isScrolled(): Boolean {
return firstVisibleItemIndex > 0 || firstVisibleItemScrollOffset > 0
}