Im not 100% sure this is actually compose related,...
# compose
z
Im not 100% sure this is actually compose related, but compose is all Ive been doing so 🤷🏽‍♂️ Since a few compose releases back, whenever I launch my app without dark-mode, the statusbar icons will go from light -> dark -> light. Im expecting them to be and remain light. Ive tried stripping out SystemUiController and the like, but no effect. My themes havent changed at all. Anyone else seeing something like this?
s
I guess it may happen if you store the theme mode preference asynchronously and you set the dark theme as the default one (and the user preference is to pick the system theme mode). Edit: You said you stripped out SystemUiController, so this is not the case, whoops
z
I do do that, but the default is to follow the system theme. Just to verify that it wasnt causing any issues I tried stripping that out as well, no difference. 🤔
I guess its worth mentioning that in dark theme the icons are always light, as expected
s
Uhm, I don't use accompanist's
SystemUiController
anymore, but I don't remember having such issue a couple of weeks ago
a
Theme setups can be finicky, do you have
Theme.Progression
defined anywhere else like
values-night
? Also, are you using something the splashscreen library? That throws another complication into the mix
z
@Alex Vanyo Just this one for the theme. I do have color and bool in values/values-night for
windowBackground
and `windowLightNavigationBar`; just for sanity I tried skipping those too but it made no difference. No splashscreen library 🙂
Oddly enough.. It works as expected on my real device. So its either an issue with the emulator, or the behavior is triggered on API 30+ only.
a
So your real device API 29 or below? API level specific behavior would not be surprising to me here at all 😅 For reference, you could check out the dark theme/light theme icon support in https://github.com/android/nowinandroid, although there we’re setting
windowLightStatusBar=true
in light mode, and
windowLightStatusBar=false
in dark mode.
Anything else potentially changing the
systemUiVisibility
flags? Use of
WindowInsetsControllerCompat
?
z
Yeah, its a Pixel 2. I love it, but its stuck on Android 11. Im pretty sure I saw the same behavior on Android 11 emulators the other day, but Ill test that tomorrow just to make sure. I was actually looking at how NIA does it earlier today - Ive tried using the same themes (android:Theme.Material...) but no difference there either. Only window adjustments I do is setDecorFitsSystemWindows(window,false); tried stripping that out as well, no bueno!
a
If you run NiA, does that one work properly in the API 30 emulator? Best advice I can give is to have a version that works, and a version that doesn’t, and slowly pare them down and change them to be closer to each other until one switches behavior
z
Seems to be API 31 and above that has the issue, its fine on the API 30 emulator as well. I tried NiA to verify. Since
windowLightStatusBar
is true by default (mine is false) I had to invert it - but with that being the only change made, seeing the same behavior there. I guess I should report it?
a
For NiA, did you change it to
true
in both the splash screen theme and the main theme? I haven’t been able to reproduce what you’re describing unfortunately.
z
Hmm 🤔 I dont think I did. Which makes me think that its actually the splash screen of my app thats causing the issue; I never see the splash screen itself, so I never thought it may be whats causing this. Ill experiment with this tomorrow morning, thanks for bringing it to my attention! Ill give an update afterwards 🙂
@Alex Vanyo I just had a chance to check, and its still happening for me. Only change I make it setting
<item name="android:windowLightStatusBar">false</item>
on both
NightAdjusted.Theme.Nia
and
NightAdjusted.Theme.Splash
. It then shows white icons, changes to dark icons briefly, then back to white. On the other hand, having
windowLightStatusBar=true
keeps the dark icons all the way through. Im curious if youre still seeing a different behavior, and if so, which device are you running it on? Could this still be an issue with the emulator? Beyond that, Im about to dig into the splash themes to see if I can find anything suspicious.