-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor navbar colour #1574
Refactor navbar colour #1574
Conversation
8e46847
to
c5c3c2c
Compare
I think you may be onto something here. I'm trying to take new screenshots and sometimes the bottom bar uses the wrong colour. Every now and then it goes right. There is indeed a race condition here... |
c5c3c2c
to
5226bf6
Compare
Rebased on #1559, no changes. |
Interesting. Have you tested if that still occurs with this change? |
It's ready IMO, but based on #1559 so marked as draft until that's merged. Though I guess you can merge this one and close the other instead if you prefer :) |
We're still setting the nav bar colour twice with this code. Just in a guaranteed ordering of |
Oh yeah, I tested this in the emulator with Android 6 and 13. And on-device with Android 13. Seemed to work as expected. |
ab81eea
to
6d99997
Compare
Rebased on |
6d99997
to
b6329e6
Compare
This comment was marked as outdated.
This comment was marked as outdated.
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) { | ||
activity.findViewById(android.R.id.content).setBackgroundColor(resolveBackgroundColor(activity)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ints as that's what most of Catima users. If you want to change the standard, let's do that in another MR (and let's start documenting these things somewhere).
And you say "I tested this in the emulator with Android 6 and 13.", I'm most curious actually about the versions that no longer run this code. So, 10 and 11 and 12 and 14 too.
So this needs a lot of testing on multiple different themes (that I don't have time to do right now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ints as that's what most of Catima users.
Does it? See above.
I'll look into testing more. No rush :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, nvm, just more testing then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out this code is responsible for correctly applying the "Pure black background for dark theme" setting when dark theme is used in the MainActivity. Adding the version check breaks the OLED black on new Android versions (noticed on Android 14)
Strangely enough, this code isn't necessary in any other activity, only the MainActivity, what a mess...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do more testing & debugging. Hopefully this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it'd be best to just leave this code on all API versions with a new comment like:
// Force correct color
// Fixes OLED dark mode in MainActivity
So we at least understand better what it does. And then later debug further
6ef5333
to
bd1376e
Compare
All Android versions seem to need this for the main screen
Follow-up for #1559 (marked draft as it is based on that to avoid a merge conflict).