E-Hentai preference tweaks

This commit is contained in:
Jobobby04 2020-06-02 22:36:24 -04:00
parent 7ce5797c7e
commit 96273c3dac
3 changed files with 362 additions and 353 deletions

View File

@ -250,4 +250,8 @@ object PreferenceKeys {
const val eh_settings_languages = "eh_settings_languages"
const val eh_enabled_categories = "eh_enabled_categories"
const val eh_secure_exh = "secure_exh"
const val eh_ehentai_quality = "ehentai_quality"
}

View File

@ -268,9 +268,9 @@ class PreferencesHelper(val context: Context) {
fun enableExhentai() = flowPrefs.getBoolean(Keys.eh_enableExHentai, false)
fun secureEXH() = flowPrefs.getBoolean("secure_exh", true)
fun secureEXH() = flowPrefs.getBoolean(Keys.eh_secure_exh, true)
fun imageQuality() = flowPrefs.getString("ehentai_quality", "auto")
fun imageQuality() = flowPrefs.getString(Keys.eh_ehentai_quality, "auto")
fun useHentaiAtHome() = flowPrefs.getBoolean("enable_hah", true)

View File

@ -145,6 +145,9 @@ class SettingsEhController : SettingsController() {
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
title = "E-Hentai"
preferenceCategory {
title = "E-Hentai Website Account Settings"
switchPreference {
title = "Enable ExHentai"
summaryOff = "Requires login"
@ -344,7 +347,8 @@ class SettingsEhController : SettingsController() {
val spanish = settingsLanguages[12].split("*").map { it.toBoolean() }
val thai = settingsLanguages[13].split("*").map { it.toBoolean() }
val vietnamese = settingsLanguages[14].split("*").map { it.toBoolean() }
val notAvailable = settingsLanguages[15].split("*").map { it.toBoolean() }
val notAvailable =
settingsLanguages[15].split("*").map { it.toBoolean() }
val other = settingsLanguages[16].split("*").map { it.toBoolean() }
with(customView) {
@ -484,14 +488,14 @@ class SettingsEhController : SettingsController() {
switchPreference {
defaultValue = true
key = "secure_exh"
key = PreferenceKeys.eh_secure_exh
title = "Secure ExHentai/E-Hentai"
summary = "Use the HTTPS version of ExHentai/E-Hentai."
}
listPreference {
defaultValue = "auto"
key = "ehentai_quality"
key = PreferenceKeys.eh_ehentai_quality
summary = "The quality of the downloaded images"
title = "Image quality"
entries = arrayOf(
@ -513,6 +517,7 @@ class SettingsEhController : SettingsController() {
onChange { preferences.imageQuality().reconfigure() }
}.dependency = PreferenceKeys.eh_enableExHentai
}
preferenceCategory {
title = "Favorites sync"