Skip to content

Conversation

@KOWX712
Copy link
Contributor

@KOWX712 KOWX712 commented Dec 23, 2025

add insets support to WebUI, no change are required for existing WebUI module.

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]>
Copy link
Contributor

Copilot AI left a 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 Insets data 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant