Skip to content

fix: defer loadUrl until WebView is laid out and support insets#151

Merged
matsuzaka-yuki merged 1 commit into
LyraVoid:mainfrom
KOWX712:webui
May 30, 2026
Merged

fix: defer loadUrl until WebView is laid out and support insets#151
matsuzaka-yuki merged 1 commit into
LyraVoid:mainfrom
KOWX712:webui

Conversation

@KOWX712

@KOWX712 KOWX712 commented May 29, 2026

Copy link
Copy Markdown
Contributor

The WebUI failed to load CSS/JS assets because the WebView was configured and loadUrl was called inside the AndroidView factory during Compose composition, which blocked the main thread and called loadUrl before the WebView had valid dimensions. Refactor to match the KernelSU pattern:

  • Create WebView and configure WebViewAssetLoader on IO dispatcher
  • Build WebView fully on Main thread outside AndroidView
  • Defer loadUrl until width > 0 && height > 0 via layout listener

Besides, ported insets feature related from KernelSU

The WebUI failed to load CSS/JS assets because the WebView was configured and loadUrl was called inside the AndroidView factory during Compose composition, which blocked the main thread and called loadUrl before the WebView had valid dimensions.
Refactor to match the KernelSU pattern:
- Create WebView and configure WebViewAssetLoader on IO dispatcher
- Build WebView fully on Main thread outside AndroidView
- Defer loadUrl until width > 0 && height > 0 via layout listener

- related:
  - tiann/KernelSU#2952
  - tiann/KernelSU#3083
  - tiann/KernelSU#3126
  - tiann/KernelSU#3190

Signed-off-by: KOWX712 <leecc0503@gmail.com>
@KOWX712

KOWX712 commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

顺便吐槽一下为什么把 local.properties 给传上来 GitHub 了

@matsuzaka-yuki matsuzaka-yuki merged commit 7300dac into LyraVoid:main May 30, 2026
3 of 4 checks passed
@KOWX712 KOWX712 deleted the webui branch May 30, 2026 11:49
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.

2 participants