-
-
Notifications
You must be signed in to change notification settings - Fork 780
Edge to edge support for webviews #5346
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
base: main
Are you sure you want to change the base?
Conversation
@Gregman-js could you check here? |
I think this PR should be changed to draft while the frontend is not yet ready to avoid merging it too early (in case the frontend changes don't make it in by 2025.6). |
And the solution chosen to handle the insets on API 36 generally seems fine to me - adding 'normal'/empty space padding in case of a frontend that does not support it. Why not do the check again after the active server changed? Meaning we're always edge to edge and change the padding in our view as needed. |
I initially wanted to do something by giving a lambda to the |
|
That could be nice, but may not be as easy on older API versions because of a scrim the system may try to force. Deprecated doesn't mean we should stopping it on older API versions if it works correctly and the behavior isn't the same on all API versions. |
The deprecated API is disabled in API 36 so we have to migrate away from it unfortunately even for old version. |
You don't have to migrate away if we can't make it work on older API versions. |
I've created POC in my repo and this approach hopefully solves all issues:
if (!serverHandleInsets) {
statusBarBackground?.updateLayoutParams {
height = safeInsets.top
}
navigationBarBackground?.updateLayoutParams {
height = safeInsets.bottom
}
} else {
// evaluateJavascript...
}
if (statusBarColor != 0 && !serverHandleInsets) {
window.statusBarColor = statusBarColor
binding.statusBarBackground.setBackgroundColor(statusBarColor)
} else {
Timber.e("Skipping coloring status bar...")
}
if (navigationBarColor != 0 && !serverHandleInsets) {
window.navigationBarColor = navigationBarColor
binding.navigationBarBackground.setBackgroundColor(navigationBarColor)
} else {
Timber.e("Skipping coloring navigation bar...")
} What do you think? |
Could you make your PR to target my branch on the official repo? If your solution works I'm ok with it but we need to make it generic for the 3 places we have a webview
Does that make sense to keep the call to the status bar color if it's deprecated if you provided an alternative solution. Please remove the modification about the trailing |
Okay, I will target your PR.
|
I can help if you want an old version of an emulator I did struggle with it too and I've found a workaround and posted it on stackoverflow https://stackoverflow.com/a/79514205/3289338 it helps you find a proper APK of the latest available webview for an old emulator. |
I created PR here #5390 for use |
Summary
Unfortunately I did not manage to properly handle the change of server since I have to enable edge to edge at the beginning of the activity. Furthermore API 36 enable edge to edge by default so we have to handle it.
See #5010 for more details.
Checklist
Screenshots
Left iOS, Right: Android

Any other notes
I did not manage to force push to the branch in #5010 after rebasing the branch so I decided to create another branch.