fix(feed): prevent group name subtitle leak into other fragments (#13366) (#13974)

Co-authored-by: TobiGr <tobigr@users.noreply.github.com>
This commit is contained in:
Nuralysha Izzati Binti ZaireiandTobiGr authored and GitHub committed 2026-10-30 16:21:56 +00:00
1 parent c32810362e
commit 24b8cbe66b
1 file changed
+14 -7
@@ -172,6 +172,10 @@ class FeedFragment : BaseStateFragment<FeedState>() {
super.onResume()
updateRelativeTimeViews()
if (groupName.isNotEmpty()) {
activity?.supportActionBar?.subtitle = groupName
}
if (updateListViewModeOnResume) {
updateListViewModeOnResume = false
@@ -182,6 +186,16 @@ class FeedFragment : BaseStateFragment<FeedState>() {
}
}
override fun onStop() {
super.onStop()
// Clear the activities' action bar subtitle when leaving the fragment to prevent
// the feed group name from leaking into subsequent views. (#13366)
if (activity?.supportActionBar?.subtitle == groupName) {
activity?.supportActionBar?.subtitle = null
}
}
private fun setupListViewMode() {
// does everything needed to setup the layouts for grid or list modes
groupAdapter.spanCount = if (shouldUseGridLayout(context)) getGridSpanCountStreams(context) else 1
@@ -288,13 +302,6 @@ class FeedFragment : BaseStateFragment<FeedState>() {
}
super.onDestroy()
if (
(groupName != "") &&
(activity?.supportActionBar?.subtitle == groupName)
) {
activity?.supportActionBar?.subtitle = null
}
}
override fun onDestroyView() {