Allow Samsung devices on Android 12+ to use dynamic theme

Since it seems to work fine, regardless of what the Material Components library seems to dictate.
This commit is contained in:
arkon
2022-01-22 14:53:12 -05:00
parent 9984e983b4
commit e3f3686b8a
3 changed files with 8 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.util.system
import android.annotation.SuppressLint
import android.os.Build
import com.google.android.material.color.DynamicColors
import logcat.LogPriority
object DeviceUtil {
@@ -30,6 +31,10 @@ object DeviceUtil {
Build.MANUFACTURER.equals("samsung", ignoreCase = true)
}
val isDynamicColorAvailable by lazy {
DynamicColors.isDynamicColorAvailable() || (isSamsung && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
}
@SuppressLint("PrivateApi")
private fun getSystemProperty(key: String?): String? {
return try {