mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 14:35:46 +00:00
android: Don't apply material you below android 12
Since you can manually change the config file now, users can force the material you theme under Android 12 and that will result in crashing on startup. This swaps to the default theme if that happens.
This commit is contained in:
parent
64b8fd0036
commit
697d61d292
1 changed files with 8 additions and 1 deletions
|
@ -5,6 +5,7 @@ package org.yuzu.yuzu_emu.utils
|
||||||
|
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.os.Build
|
||||||
import androidx.annotation.ColorInt
|
import androidx.annotation.ColorInt
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
@ -23,7 +24,13 @@ object ThemeHelper {
|
||||||
setThemeMode(activity)
|
setThemeMode(activity)
|
||||||
when (Theme.from(IntSetting.THEME.getInt())) {
|
when (Theme.from(IntSetting.THEME.getInt())) {
|
||||||
Theme.Default -> activity.setTheme(R.style.Theme_Yuzu_Main)
|
Theme.Default -> activity.setTheme(R.style.Theme_Yuzu_Main)
|
||||||
Theme.MaterialYou -> activity.setTheme(R.style.Theme_Yuzu_Main_MaterialYou)
|
Theme.MaterialYou -> {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
|
activity.setTheme(R.style.Theme_Yuzu_Main_MaterialYou)
|
||||||
|
} else {
|
||||||
|
activity.setTheme(R.style.Theme_Yuzu_Main)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Using a specific night mode check because this could apply incorrectly when using the
|
// Using a specific night mode check because this could apply incorrectly when using the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue