mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-20 00:35:47 +01:00
Fix colored status bar on full-screen dialogs.
This commit is contained in:
committed by
Cody Henthorne
parent
406be67a6f
commit
1e5b7868fd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user