Split the rest of the preferences in PreferencesHelper (#8074)

* Split the reset of the preferences in PreferencesHelper

* Capitalize ThemeMode
This commit is contained in:
Andreas
2022-09-25 16:07:06 +02:00
committed by GitHub
parent 0fabe4bd01
commit 29fa93e829
51 changed files with 319 additions and 275 deletions

View File

@@ -0,0 +1,26 @@
package eu.kanade.domain.base
import android.content.Context
import eu.kanade.tachiyomi.core.preference.PreferenceStore
import eu.kanade.tachiyomi.core.preference.getEnum
import eu.kanade.tachiyomi.data.preference.PreferenceValues
import eu.kanade.tachiyomi.util.system.DeviceUtil
class BasePreferences(
val context: Context,
private val preferenceStore: PreferenceStore,
) {
fun confirmExit() = preferenceStore.getBoolean("pref_confirm_exit", false)
fun downloadedOnly() = preferenceStore.getBoolean("pref_downloaded_only", false)
fun incognitoMode() = preferenceStore.getBoolean("incognito_mode", false)
fun automaticExtUpdates() = preferenceStore.getBoolean("automatic_ext_updates", true)
fun extensionInstaller() = preferenceStore.getEnum(
"extension_installer",
if (DeviceUtil.isMiui) PreferenceValues.ExtensionInstaller.LEGACY else PreferenceValues.ExtensionInstaller.PACKAGEINSTALLER,
)
}