mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-22 13:53:56 +00:00
???
This commit is contained in:
@@ -20,7 +20,10 @@ class BasePreferences(
|
||||
|
||||
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)
|
||||
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"),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package eu.kanade.domain.base
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.tachiyomi.util.system.hasMiuiPackageInstaller
|
||||
import eu.kanade.domain.base.BasePreferences.ExtensionInstaller
|
||||
import eu.kanade.tachiyomi.util.system.hasMiuiPackageInstaller
|
||||
import eu.kanade.tachiyomi.util.system.isShizukuInstalled
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import tachiyomi.core.preference.Preference
|
||||
@@ -19,14 +19,14 @@ class ExtensionInstallerPreference(
|
||||
override fun key() = "extension_installer"
|
||||
|
||||
|
||||
|
||||
val entries get() = BasePreferences.ExtensionInstaller.values().run {
|
||||
if (context.hasMiuiPackageInstaller) {
|
||||
filter { it != BasePreferences.ExtensionInstaller.PACKAGEINSTALLER }
|
||||
} else {
|
||||
toList()
|
||||
val entries
|
||||
get() = ExtensionInstaller.values().run {
|
||||
if (context.hasMiuiPackageInstaller) {
|
||||
filter { it != ExtensionInstaller.PACKAGEINSTALLER }
|
||||
} else {
|
||||
toList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun defaultValue() = if (context.hasMiuiPackageInstaller) {
|
||||
ExtensionInstaller.LEGACY
|
||||
@@ -39,9 +39,11 @@ class ExtensionInstallerPreference(
|
||||
ExtensionInstaller.PACKAGEINSTALLER -> {
|
||||
if (context.hasMiuiPackageInstaller) return ExtensionInstaller.LEGACY
|
||||
}
|
||||
|
||||
ExtensionInstaller.SHIZUKU -> {
|
||||
if (!context.isShizukuInstalled) return defaultValue()
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user