Status Update
Comments
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #2
Any updates on this? It's still an issue, specifically for SDK30+ as the implementation switches from checking systemUiVisibility flags
va...@google.com <va...@google.com> #3
Can you see if this issue is still present in version 1.8.0-alpha07
? The implementation has changed a bit since 1.8.0-alpha04
, so it's possible this was resolved.
al...@google.com <al...@google.com> #4
I'm working internally, so would it be possible to update the version there?
Edit: Discussed offline
va...@google.com <va...@google.com> #5
It looks like the issue here is querying isAppearanceLightStatusBars
on API 30 and above when the value hasn't been set by WindowInsetsControllerCompat
itself, likely due to:
A potential workaround is to rely on internal platform behavior, and flip the flag stopping the real value being reported with something like window.insetsController?.setSystemBarsAppearance(0, 0)
. Even though the mask is zero (meaning no appearance has changed), that method has the side-effect of flipping the controlled flag:
va...@google.com <va...@google.com>
ro...@veeva.com <ro...@veeva.com> #6
After more than 1 year this is still an issue. Can we please add the workaround from #5 to WindowCompat
?
al...@google.com <al...@google.com> #7
va...@google.com <va...@google.com>
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit ec9dcf2d9b05266d6a7e8001b255a0db83e85545
Author: Alex Vanyo <vanyo@google.com>
Date: Thu May 05 21:42:04 2022
Fix retrieving initial system bar appearance on API 30+
Fixes: 219993701
Test: New tests
Change-Id: I1859688c4d89fa7c365eb420fb1646af0b7cd7db
M core/core/src/androidTest/AndroidManifest.xml
A core/core/src/androidTest/java/androidx/core/view/DarkSystemBarsActivity.java
A core/core/src/androidTest/java/androidx/core/view/LightSystemBarsActivity.java
A core/core/src/androidTest/java/androidx/core/view/ThemeSystemBarsTest.kt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt
M core/core/src/androidTest/res/values/styles.xml
M core/core/src/main/java/androidx/core/view/WindowInsetsControllerCompat.java
Description
Component used: androidx.core:core-ktx
Version used: 1.8.0-alpha04
Devices/Android versions reproduced on: PIXEL 5/A12
Short Description:
windowInsetsController.isAppearanceLightStatusBars
always returns false.Explanation: When I'm trying to get the default
isAppearanceLightStatusBars
value it always returnsfalse
for the first time for both Light and Dark theme. So I am forced to use deprecated way to determine this value: