-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add missing window flags for styling system bars #32167
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
Can you add a test that verifies these flag settings independent of the divider color being set?
window.clearFlags( | ||
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | ||
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); | ||
|
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.
These flags are deprecated in API 30
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.
They are needed to fix the problem for API < 30, so I added a comment noting the deprecation and suppressed the warning
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.
What does the status bar look like on API 27?
It looks the same as the pictures above! I also tested this on API 21 to see what happens when none of the operations can be performed (API 23 is needed at least), and it looks the same with and without setting/clearing the flags. I can also move the setting/clearing of flags after the SDK versions are checked for each operation (like here) to rule out side effects, but I was just trying to avoid redundant code. |
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.
LGTM
Addresses the inability to set the icon brightness on system bars on API 30, part of issue #10027.
Using the reproduction included in the issue noted above, I was able to produce the following on a Pixel 2 emulator running API 30 with this change (see before here):
I confirmed these results on Pixel devices running API 28 (with this revert included), 29, and 31.
Pre-launch Checklist
writing and running engine tests.
///
).