-
Notifications
You must be signed in to change notification settings - Fork 630
manager: add insets support to webui #1340
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
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. Co-Authored-By: Der_Googler <[email protected]> Co-Authored-By: Light_summer <[email protected]> Signed-off-by: KOWX712 <[email protected]>
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.
Pull request overview
This pull request adds window insets support to the WebUI feature, allowing web modules to adapt their layout to device screen safe areas (notches, status bars, and navigation bars). This is synchronized from KernelSU issues #2952 and #3083.
Key changes:
- Introduced an
Insetsdata class that generates CSS variables for safe area handling - Added JavaScript interface method
enableInsets()to toggle insets behavior dynamically - Refactored WebView initialization to support both traditional padding-based layout and CSS variable-based insets
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| app/src/main/java/me/bmax/apatch/ui/webui/Insets.kt | New data class that encapsulates inset values and generates CSS custom properties for web content |
| app/src/main/java/me/bmax/apatch/ui/webui/SuFilePathHandler.java | Added interfaces for insets supplier and listener, plus CSS file intercept for serving insets dynamically |
| app/src/main/java/me/bmax/apatch/ui/webui/WebViewInterface.kt | Added enableInsets() JavaScript interface method to toggle insets mode from web code |
| app/src/main/java/me/bmax/apatch/ui/WebUIActivity.kt | Major refactoring: moved WebView into FrameLayout container, implemented dynamic insets handling, and added suspension logic for insets initialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
add insets support to WebUI, no change are required for existing WebUI module.