Settings cleanup (#7126)

* Settings cleanup

* Oops

* Also hide "Invert tap zones" if tap zones is set to "Disabled" in ReaderReadingModeSettings
This commit is contained in:
CVIUS
2022-05-15 21:37:52 +08:00
committed by GitHub
parent 6fb5552d57
commit 4c9331c4e9
3 changed files with 17 additions and 6 deletions
@@ -72,7 +72,9 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding.pagerPrefsGroup.tappingInverted.bindToPreference(preferences.pagerNavInverted())
binding.pagerPrefsGroup.pagerNav.bindToPreference(preferences.navigationModePager())
preferences.navigationModePager()
.asImmediateFlow { binding.pagerPrefsGroup.tappingInverted.isVisible = it != 5 }
.launchIn((context as ReaderActivity).lifecycleScope)
// Makes so that landscape zoom gets hidden away when image scale type is not fit screen
binding.pagerPrefsGroup.scaleType.bindToPreference(preferences.imageScaleType(), 1)
preferences.imageScaleType()
@@ -102,6 +104,9 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding.webtoonPrefsGroup.tappingInverted.bindToPreference(preferences.webtoonNavInverted())
binding.webtoonPrefsGroup.webtoonNav.bindToPreference(preferences.navigationModeWebtoon())
preferences.navigationModeWebtoon()
.asImmediateFlow { binding.webtoonPrefsGroup.tappingInverted.isVisible = it != 5 }
.launchIn((context as ReaderActivity).lifecycleScope)
binding.webtoonPrefsGroup.cropBordersWebtoon.bindToPreference(preferences.cropBordersWebtoon())
binding.webtoonPrefsGroup.webtoonSidePadding.bindToIntPreference(preferences.webtoonSidePadding(), R.array.webtoon_side_padding_values)