BasePreferences.kt 875 B

123456789101112131415161718192021222324
  1. package eu.kanade.domain.base
  2. import android.content.Context
  3. import eu.kanade.tachiyomi.core.preference.PreferenceStore
  4. import eu.kanade.tachiyomi.util.system.isPreviewBuildType
  5. import eu.kanade.tachiyomi.util.system.isReleaseBuildType
  6. class BasePreferences(
  7. val context: Context,
  8. private val preferenceStore: PreferenceStore,
  9. ) {
  10. fun confirmExit() = preferenceStore.getBoolean("pref_confirm_exit", false)
  11. fun downloadedOnly() = preferenceStore.getBoolean("pref_downloaded_only", false)
  12. fun incognitoMode() = preferenceStore.getBoolean("incognito_mode", false)
  13. fun automaticExtUpdates() = preferenceStore.getBoolean("automatic_ext_updates", true)
  14. fun extensionInstaller() = ExtensionInstallerPreference(context, preferenceStore)
  15. fun acraEnabled() = preferenceStore.getBoolean("acra.enable", isPreviewBuildType || isReleaseBuildType)
  16. }