-
Notifications
You must be signed in to change notification settings - Fork 6k
Partially remove setSystemUiVisibility() usages #31092
Conversation
Differences between this PR and the reverted originalAdded backwards compatibility for API 19 Corrected default system UI mode Corrected miscellaneous errors Another thing I missed is that the |
| window.setStatusBarColor(0x40000000); | ||
| window.getDecorView().setSystemUiVisibility(PlatformPlugin.DEFAULT_SYSTEM_UI); | ||
| WindowCompat.setDecorFitsSystemWindows(window, false); | ||
| if (Build.VERSION.SDK_INT < 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.
does it need to also check for Build.VERSION.SDK_INT >= 19?
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.
No, because it works for SDK >= 16! You can see that in the source code at the bottom of this page.
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.
it looks like this caused a regression for SDK_INT >= 30. See b/223628114
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.
Ok, I'm investigating a fix for this to re-land it.
| window.getDecorView().setSystemUiVisibility(PlatformPlugin.DEFAULT_SYSTEM_UI); | ||
| WindowCompat.setDecorFitsSystemWindows(window, false); | ||
| if (Build.VERSION.SDK_INT < 30) { | ||
| // This ensures that the navigation bar is not hidden for APIs 19-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.
is it 19-29 (inclusive) or 19-30 (inclusive)?
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.
It is technically 16-29 inclusive (I put 19 because of what Flutter supports). I will update the comment to better reflect that!
blasten
left a comment
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
|
This needs a rebase for the presubmits. |
Piinks
left a comment
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.
This reverts commit 1e5b26b.
This reverts commit 68473fe.

This PR seeks to partially address Issue #91128 by using backwards compatible overlay/inset APIs provided by Android as of API 30.
Because Flutter still supports API 19 and these APIs leave a gap in compatibility for APIs 19-29, this cannot fully be accomplished, but this PR refactors code such that when this code can be removed, it will be straightforward to do so. See comment below for details.
CC: @wytesk133 (sorry, couldn't put as reviewer)
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.