* Uses Voyager for navigation. * Replaces every screen inside settings except category editor screen since it's called from several places. (cherry picked from commit 890f1a3c7b0f2ceefa86a77cb40c11567e2b5a46) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt # app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt
29 lines
1.0 KiB
Kotlin
29 lines
1.0 KiB
Kotlin
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,
|
|
)
|
|
|
|
fun acraEnabled() = preferenceStore.getBoolean("acra.enable", true)
|
|
}
|