mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-26 02:48:24 +01:00
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:
parent
6fb5552d57
commit
4c9331c4e9
@ -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)
|
||||
|
||||
|
@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.data.cache.ChapterCache
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateService.Target
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceValues
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.network.PREF_DOH_ADGUARD
|
||||
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
|
||||
@ -59,6 +60,7 @@ class SettingsAdvancedController(
|
||||
|
||||
private val network: NetworkHelper by injectLazy()
|
||||
private val chapterCache: ChapterCache by injectLazy()
|
||||
private val trackManager: TrackManager by injectLazy()
|
||||
|
||||
@SuppressLint("BatteryLife")
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply {
|
||||
@ -212,12 +214,14 @@ class SettingsAdvancedController(
|
||||
|
||||
onClick { LibraryUpdateService.start(context, target = Target.COVERS) }
|
||||
}
|
||||
preference {
|
||||
key = "pref_refresh_library_tracking"
|
||||
titleRes = R.string.pref_refresh_library_tracking
|
||||
summaryRes = R.string.pref_refresh_library_tracking_summary
|
||||
if (trackManager.hasLoggedServices()) {
|
||||
preference {
|
||||
key = "pref_refresh_library_tracking"
|
||||
titleRes = R.string.pref_refresh_library_tracking
|
||||
summaryRes = R.string.pref_refresh_library_tracking_summary
|
||||
|
||||
onClick { LibraryUpdateService.start(context, target = Target.TRACKING) }
|
||||
onClick { LibraryUpdateService.start(context, target = Target.TRACKING) }
|
||||
}
|
||||
}
|
||||
preference {
|
||||
key = "pref_reset_viewer_flags"
|
||||
|
@ -165,6 +165,7 @@ class SettingsReaderController : SettingsController() {
|
||||
TappingInvertMode.BOTH.name,
|
||||
)
|
||||
summary = "%s"
|
||||
visibleIf(preferences.navigationModePager()) { it != 5 }
|
||||
}
|
||||
intListPreference {
|
||||
bindTo(preferences.imageScaleType())
|
||||
@ -244,6 +245,7 @@ class SettingsReaderController : SettingsController() {
|
||||
TappingInvertMode.BOTH.name,
|
||||
)
|
||||
summary = "%s"
|
||||
visibleIf(preferences.navigationModeWebtoon()) { it != 5 }
|
||||
}
|
||||
intListPreference {
|
||||
bindTo(preferences.webtoonSidePadding())
|
||||
|
Loading…
Reference in New Issue
Block a user