mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 09:43:56 +00:00
31 lines
1013 B
Kotlin
31 lines
1013 B
Kotlin
package eu.kanade.domain.base
|
|
|
|
import android.content.Context
|
|
import android.content.pm.PackageManager
|
|
import android.os.Build
|
|
import tachiyomi.core.preference.PreferenceStore
|
|
|
|
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 extensionInstaller() = ExtensionInstallerPreference(context, preferenceStore)
|
|
|
|
fun acraEnabled() = preferenceStore.getBoolean("acra.enable", true)
|
|
|
|
fun deviceHasPip() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && context.packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)
|
|
|
|
enum class ExtensionInstaller(val titleResId: String) {
|
|
LEGACY("Legacy"),
|
|
PACKAGEINSTALLER("PackageInstaller"),
|
|
SHIZUKU("Shizuku"),
|
|
}
|
|
}
|