Fix empty state + cleaning + changelog

This commit is contained in:
Valere 2021-03-31 17:36:24 +02:00 committed by Benoit Marty
parent b390980ca2
commit cd6fab0e2d
3 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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 ->

View file

@ -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,