Add preference to disable swipe gesture for switching tabs, close #1718 (#1752)

This commit is contained in:
Ivan Kupalov 2020-04-27 21:41:43 +02:00 committed by GitHub
commit f52fd355d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View file

@ -168,6 +168,11 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
val pageMargin = resources.getDimensionPixelSize(R.dimen.tab_page_margin)
viewPager.setPageTransformer(MarginPageTransformer(pageMargin))
val uswSwipeForTabs = PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("enableSwipeForTabs", true)
viewPager.isUserInputEnabled = uswSwipeForTabs
tabLayout.addOnTabSelectedListener(object : OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab) {
if (tab.position == notificationTabPosition) {

View file

@ -129,7 +129,7 @@ class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreference
}
"statusTextSize", "absoluteTimeView", "showBotOverlay", "animateGifAvatars",
"useBlurhash", "showCardsInTimelines", "confirmReblogs" -> {
"useBlurhash", "showCardsInTimelines", "confirmReblogs", "enableSwipeForTabs" -> {
restartActivitiesOnExit = true
}
"language" -> {