diff options
Diffstat (limited to 'src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt index e55767c0f..f312e24cf 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt @@ -3,21 +3,19 @@ package org.yuzu.yuzu_emu.utils -import android.app.Activity import android.content.res.Configuration import android.graphics.Color import androidx.annotation.ColorInt import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate -import androidx.core.content.ContextCompat import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsControllerCompat import androidx.preference.PreferenceManager +import kotlin.math.roundToInt import org.yuzu.yuzu_emu.R import org.yuzu.yuzu_emu.YuzuApplication import org.yuzu.yuzu_emu.features.settings.model.Settings import org.yuzu.yuzu_emu.ui.main.ThemeProvider -import kotlin.math.roundToInt object ThemeHelper { const val SYSTEM_BAR_ALPHA = 0.9f @@ -36,8 +34,8 @@ object ThemeHelper { // Using a specific night mode check because this could apply incorrectly when using the // light app mode, dark system mode, and black backgrounds. Launching the settings activity // will then show light mode colors/navigation bars but with black backgrounds. - if (preferences.getBoolean(Settings.PREF_BLACK_BACKGROUNDS, false) - && isNightMode(activity) + if (preferences.getBoolean(Settings.PREF_BLACK_BACKGROUNDS, false) && + isNightMode(activity) ) { activity.setTheme(R.style.ThemeOverlay_Yuzu_Dark) } @@ -46,8 +44,10 @@ object ThemeHelper { @ColorInt fun getColorWithOpacity(@ColorInt color: Int, alphaFactor: Float): Int { return Color.argb( - (alphaFactor * Color.alpha(color)).roundToInt(), Color.red(color), - Color.green(color), Color.blue(color) + (alphaFactor * Color.alpha(color)).roundToInt(), + Color.red(color), + Color.green(color), + Color.blue(color) ) } |