feat: native tab panel overlay, webapp height no longer reserved
This commit is contained in:
@@ -69,6 +69,11 @@ class JsBridge(
|
||||
// 壁纸提供接口(base64)
|
||||
// Wallpaper provider (base64)
|
||||
private val wallpaper: WallpaperProvider? = null,
|
||||
// 标签面板回调:由 MainActivity 实现,弹出原生标签面板(PopupWindow,在内容
|
||||
// WebView 之上,不占用预留高度)
|
||||
// Tab panel callback implemented by MainActivity: shows a native tab panel
|
||||
// (PopupWindow above the content WebView, no reserved height)
|
||||
private val onShowTabPanel: (() -> Unit)? = null,
|
||||
) {
|
||||
private val gson = com.google.gson.Gson()
|
||||
|
||||
@@ -212,6 +217,14 @@ class JsBridge(
|
||||
Log.d("HearthBridge", "hideWebApps called")
|
||||
}
|
||||
|
||||
// 弹出原生标签面板(H5 顶栏标签按钮点击时调用)
|
||||
// Show the native tab panel (called when the H5 topbar tab button is tapped)
|
||||
@android.webkit.JavascriptInterface
|
||||
fun showTabPanel() {
|
||||
Log.d("HearthBridge", "showTabPanel called")
|
||||
onShowTabPanel?.invoke()
|
||||
}
|
||||
|
||||
// 清单内存缓存:首次拉取成功后缓存,后续复用(避免 openWebApp 重复 I/O)
|
||||
// 空结果(离线失败)不缓存,下次调用重试拉取,避免空清单被永久缓存
|
||||
// In-memory manifest cache: cache only on a successful non-empty fetch (avoid
|
||||
|
||||
Reference in New Issue
Block a user