diff --git a/CHANGES.md b/CHANGES.md index ed549c918f..45b3905375 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Improvements 🙌: - Update reactions to Unicode 13.1 (#2998) - Be more robust when parsing some enums - Improve timeline filtering (dissociate membership and profile events, display hidden events when highlighted, fix hidden item/read receipts behavior) + - Room list improvements (paging) Bugfix 🐛: - Fix bad theme change for the MainActivity diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt index ac59283e7a..cf74cae37c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListFragment.kt @@ -249,7 +249,7 @@ class RoomListFragment @Inject constructor( val contentAdapter = pagedControllerFactory.createRoomSummaryPagedController().also { section.livePages.observe(viewLifecycleOwner) { pl -> it.submitList(pl) - sectionAdapter.updateSection(sectionAdapter.section.copy(isHidden = pl.isEmpty() || hasOnlyOneSection)) + sectionAdapter.updateSection(sectionAdapter.section.copy(isHidden = pl.isEmpty())) checkEmptyState() } section.notificationCount.observe(viewLifecycleOwner) { counts -> diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt b/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt index 30f0e671f9..b137947ef7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt @@ -64,7 +64,7 @@ class SectionHeaderAdapter constructor( holder.bind(section) } - override fun getItemCount(): Int = 1.takeIf { section.isHidden.not() } ?: 0 + override fun getItemCount(): Int = if (section.isHidden) 0 else 1 class VH constructor( private val binding: ItemRoomCategoryBinding,