Skip to content

Commit

Permalink
Fix TopBar visibility reset after onResume in MultiSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar0-0 committed Jan 11, 2025
1 parent 81af290 commit f3e9043
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ class MainActivityListHostFragment : Fragment(R.layout.main_activity_list_host_f
.findViewById<View>(R.id.fragment_container)
.findNavController()
.addOnDestinationChangedListener(destinationChangedListener)

if(conversationListTabsViewModel.isMultiSelectOpen()) {
presentToolbarForMultiselect()
}
}

override fun onPause() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class ConversationListTabsViewModel(startingTab: ConversationListTab, repository
performStoreUpdate { it.copy(visibilityState = it.visibilityState.copy(isMultiSelectOpen = true)) }
}

fun isMultiSelectOpen(): Boolean {
return store.state.visibilityState.isMultiSelectOpen
}

fun onMultiSelectFinished() {
performStoreUpdate { it.copy(visibilityState = it.visibilityState.copy(isMultiSelectOpen = false)) }
}
Expand Down

0 comments on commit f3e9043

Please sign in to comment.