-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Display WebView under navigation bar #5010
base: master
Are you sure you want to change the base?
Conversation
70bf859
to
c47769c
Compare
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) | ||
val bottomInset = if (bottomInsetsApplied) 0 else insets.bottom | ||
|
||
v.updatePadding( | ||
top = insets.top, | ||
bottom = bottomInset | ||
) | ||
|
||
rootInsets = Insets.of(insets.left, 0, insets.right, insets.bottom - bottomInset) | ||
|
||
WindowInsetsCompat.CONSUMED |
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.
Could make sense to call the default onApplyWindowInsets
here so the env
is set properly in case the bug is ever fixed in Android
I don't want to do too much review while there is no frontend decision, but why is the status bar/top inset excluded? |
@jpelgrom From my initial analysis, it turned out that the frontend is not yet adapted to the top insets. Even the iOS app does not draw webview under the status bar(If I haven't missed anything) |
We have decided to accept the overall approach. Just have some nitpicks on the frontend PR
I think the app should provide all the insets and let frontend decide what to do. As long as we are not breaking it, of course |
super.onCreate(savedInstanceState) | ||
|
||
binding = ActivityWebviewBinding.inflate(layoutInflater) | ||
|
||
bottomInsetsApplied = serverManager.getServer()?.version?.isAtLeast(2026, 1) == true |
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.
The server/server version might change after the activity is created, most likely in multi-server scenarios. This will only check the current active server which might break UI if at some point it loads another, older frontend version. Not sure what the best fix is but that scenario should be handled.
Summary
Enable EdgeToEdge on WebViewActivity, show WebView under navigation bar.
Applying insets depend on server release with this changes. We shouldn't display webview under navigation bar before frontend release because some ui elements will overlap with navigation bar.
After releasing this two PR we can even show webview under status bar on Android and iOS in future PR's.
We need to do something in this area because when HA will target api 35 some apis releated to changing status bar and navigation bar color will be not available docs
Screenshots
Left iOS, Right: Android
![image](https://private-user-images.githubusercontent.com/39136587/406692536-74d16656-02da-4894-9d3e-5c01fdb0afce.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODYxMzAsIm5iZiI6MTczODk4NTgzMCwicGF0aCI6Ii8zOTEzNjU4Ny80MDY2OTI1MzYtNzRkMTY2NTYtMDJkYS00ODk0LTlkM2UtNWMwMWZkYjBhZmNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAzMzcxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAzYzcyYzFlMTBjNjE5ZTNhMTUyNmZjODAwZGI0MTFkMmQ5Mjg4ZTk5YTIyNjA4YTNhOTU1ZjUxNGFkYWY4YWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7uH4YUKFGMa0ApUeIcVCv1Xgcdw0di6UVCw-Ritz4h0)
Any other notes
Dependency: home-assistant/frontend#23811
Related issue: #4547