From f6f6b3782686c6607d0ab70a8f3db9b5d15d1372 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 21 Jul 2025 10:43:37 +0200 Subject: [PATCH] Fixed status bar text color --- .../java/eu/faircode/email/ActivityBase.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index d2618063be..ddc2d7f609 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -344,18 +344,20 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc EdgeToEdge.enable(this); boolean edge_to_edge = prefs.getBoolean("edge_to_edge", false); - int colorPrimary = (edge_to_edge - ? (Helper.isDarkTheme(this) ? Color.BLACK : Color.WHITE) - : Helper.resolveColor(this, androidx.appcompat.R.attr.colorPrimary)); - double lum = ColorUtils.calculateLuminance(colorPrimary); + int colorStatus = Helper.resolveColor(this, androidx.appcompat.R.attr.colorPrimary); + int colorNavigation = (edge_to_edge + ? (Helper.isDarkTheme(this) ? Color.BLACK : Color.WHITE) : colorStatus); + double lumStatus = ColorUtils.calculateLuminance(colorStatus); + double lumNavigation = ColorUtils.calculateLuminance(colorNavigation); EntityLog.log(this, "NAVBAR e2e=" + edge_to_edge + - " color=" + Integer.toHexString(colorPrimary) + + " color=" + Integer.toHexString(colorStatus) + "/" + Integer.toHexString(colorNavigation) + " dark=" + Helper.isDarkTheme(this) + - " lum=" + lum + " light=" + (lum > LUMINANCE_THRESHOLD)); + " lum=" + lumStatus + "/" + lumNavigation + + " light=" + (lumStatus > LUMINANCE_THRESHOLD) + "/" + (lumNavigation > LUMINANCE_THRESHOLD)); WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(window, window.getDecorView()); - controller.setAppearanceLightStatusBars(lum > LUMINANCE_THRESHOLD); - controller.setAppearanceLightNavigationBars(lum > LUMINANCE_THRESHOLD); + controller.setAppearanceLightStatusBars(lumStatus > LUMINANCE_THRESHOLD); + controller.setAppearanceLightNavigationBars(lumNavigation > LUMINANCE_THRESHOLD); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) { window.setNavigationBarColor(Color.TRANSPARENT); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)