From f4e2eca256bc7072ac4f1360713d8aa7c748fe05 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 16 Jul 2021 21:21:10 +0200 Subject: [PATCH] Simplified code and adjusted the style so that it's similar to FeedFragment --- .../local/subscription/SubscriptionFragment.kt | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt index 5b5bda498..a92e4f1fc 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt @@ -112,13 +112,6 @@ class SubscriptionFragment : BaseStateFragment() { setupInitialLayout() } - override fun setUserVisibleHint(isVisibleToUser: Boolean) { - super.setUserVisibleHint(isVisibleToUser) - if (activity != null && isVisibleToUser) { - setTitle(activity.getString(R.string.tab_subscriptions)) - } - } - override fun onAttach(context: Context) { super.onAttach(context) subscriptionManager = SubscriptionManager(requireContext()) @@ -156,11 +149,8 @@ class SubscriptionFragment : BaseStateFragment() { override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { super.onCreateOptionsMenu(menu, inflater) - val supportActionBar = activity.supportActionBar - if (supportActionBar != null) { - supportActionBar.setDisplayShowTitleEnabled(true) - setTitle(getString(R.string.tab_subscriptions)) - } + activity.supportActionBar?.setDisplayShowTitleEnabled(true) + activity.supportActionBar?.setTitle(R.string.tab_subscriptions) } private fun setupBroadcastReceiver() {