fix MainActivity title when coming from a notification (#1844)

main
Konrad Pozniak 4 years ago committed by Alibek Omarov
parent 4d811dc51d
commit 0e6ad0eee7
  1. 7
      app/src/main/java/com/keylesspalace/tusky/MainActivity.kt

@ -489,8 +489,8 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
val pageMargin = resources.getDimensionPixelSize(R.dimen.tab_page_margin) val pageMargin = resources.getDimensionPixelSize(R.dimen.tab_page_margin)
viewPager.setPageTransformer(MarginPageTransformer(pageMargin)) viewPager.setPageTransformer(MarginPageTransformer(pageMargin))
val uswSwipeForTabs = preferences.getBoolean("enableSwipeForTabs", true) val enableSwipeForTabs = preferences.getBoolean("enableSwipeForTabs", true)
viewPager.isUserInputEnabled = uswSwipeForTabs viewPager.isUserInputEnabled = enableSwipeForTabs
onTabSelectedListener?.let { onTabSelectedListener?.let {
activeTabLayout.removeOnTabSelectedListener(it) activeTabLayout.removeOnTabSelectedListener(it)
@ -517,7 +517,8 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
activeTabLayout.addOnTabSelectedListener(it) activeTabLayout.addOnTabSelectedListener(it)
} }
mainToolbar.title = tabs[0].title(this@MainActivity) val activeTabPosition = if (selectNotificationTab) notificationTabPosition else 0
mainToolbar.title = tabs[activeTabPosition].title(this@MainActivity)
} }

Loading…
Cancel
Save