mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 19:36:08 +03:00
Renaming observe item count method
This commit is contained in:
parent
291d7d7627
commit
a826a50c10
1 changed files with 4 additions and 5 deletions
|
@ -52,7 +52,6 @@ import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedA
|
|||
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedActionViewModel
|
||||
import im.vector.app.features.home.room.list.widget.NotifsFabMenuView
|
||||
import im.vector.app.features.notifications.NotificationDrawerManager
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -291,7 +290,7 @@ class RoomListFragment @Inject constructor(
|
|||
))
|
||||
checkEmptyState()
|
||||
}
|
||||
listenItemCount(section, sectionAdapter)
|
||||
observeItemCount(section, sectionAdapter)
|
||||
section.notificationCount.observe(viewLifecycleOwner) { counts ->
|
||||
sectionAdapter.updateSection(sectionAdapter.roomsSectionData.copy(
|
||||
notificationCount = counts.totalCount,
|
||||
|
@ -315,7 +314,7 @@ class RoomListFragment @Inject constructor(
|
|||
))
|
||||
checkEmptyState()
|
||||
}
|
||||
listenItemCount(section, sectionAdapter)
|
||||
observeItemCount(section, sectionAdapter)
|
||||
section.isExpanded.observe(viewLifecycleOwner) { _ ->
|
||||
refreshCollapseStates()
|
||||
}
|
||||
|
@ -332,7 +331,7 @@ class RoomListFragment @Inject constructor(
|
|||
isLoading = false))
|
||||
checkEmptyState()
|
||||
}
|
||||
listenItemCount(section, sectionAdapter)
|
||||
observeItemCount(section, sectionAdapter)
|
||||
section.notificationCount.observe(viewLifecycleOwner) { counts ->
|
||||
sectionAdapter.updateSection(sectionAdapter.roomsSectionData.copy(
|
||||
notificationCount = counts.totalCount,
|
||||
|
@ -380,7 +379,7 @@ class RoomListFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun listenItemCount(section: RoomsSection, sectionAdapter: SectionHeaderAdapter) {
|
||||
private fun observeItemCount(section: RoomsSection, sectionAdapter: SectionHeaderAdapter) {
|
||||
lifecycleScope.launch {
|
||||
section.itemCount
|
||||
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
|
||||
|
|
Loading…
Reference in a new issue