mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2026-11-23 15:47:20 +00:00
Co-authored-by: TobiGr <tobigr@users.noreply.github.com>
This commit is contained in:
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() {
|
||||
|
||||
Reference in new issue
Block a user