From 1e5b7868fd1b5f43cd6349279fc59212a9b22ca4 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Wed, 9 Sep 2026 15:26:51 -0300 Subject: [PATCH] Fix colored status bar on full-screen dialogs. --- .../main/java/org/signal/core/ui/WindowExtensions.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/ui/src/main/java/org/signal/core/ui/WindowExtensions.kt b/core/ui/src/main/java/org/signal/core/ui/WindowExtensions.kt index 291fc57934..49a3de73b2 100644 --- a/core/ui/src/main/java/org/signal/core/ui/WindowExtensions.kt +++ b/core/ui/src/main/java/org/signal/core/ui/WindowExtensions.kt @@ -34,16 +34,17 @@ fun Window.initializeScreenshotSecurity() { * * Bar icon appearance (`windowLightStatusBar` / `windowLightNavigationBar`) is left to the window's theme, * which stays honored under edge-to-edge. + * + * The bar colors are cleared on every API level, including 35+. The platform only forces them transparent + * for windows it treats as edge-to-edge enforced, and that is not reliable for dialog windows, which + * otherwise keep the theme's `android:statusBarColor` (`?attr/colorPrimaryDark`) and paint a colored bar over + * our content. androidx.activity's own API 35 path clears both for the same reason; where the platform really + * does enforce edge-to-edge the setters are simply no-ops. */ @Suppress("DEPRECATION") fun Window.enableEdgeToEdge() { WindowCompat.setDecorFitsSystemWindows(this, false) - if (Build.VERSION.SDK_INT >= 35) { - // Edge-to-edge is enforced, which forces the bars transparent and makes both setters no-ops. - return - } - statusBarColor = Color.TRANSPARENT navigationBarColor = when { Build.VERSION.SDK_INT >= 29 -> Color.TRANSPARENT