6.6.3 - Alpha - 修复导航栏遮挡在线文档内容问题
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
{
|
||||
"$data": {
|
||||
"v6.6.3": {
|
||||
"released_date": "2025/04/16",
|
||||
"fix": [
|
||||
"主页文档标签显示在线文档时部分内容被系统导航栏遮挡的问题"
|
||||
]
|
||||
},
|
||||
"v6.6.2": {
|
||||
"released_date": "2025/04/16",
|
||||
"feature": [
|
||||
@@ -23,7 +29,7 @@
|
||||
"ui.inflate 返回值丢失 attr/on/click 等原型方法的问题",
|
||||
"部分方法调用出现异常时无法被 try..catch 块捕获的问题 _[`issue #345`](http://issues.autojs6.com/345)_",
|
||||
"布局分析页面生成代码时可能导致应用崩溃的问题 _[`issue #288`](http://issues.autojs6.com/288)_",
|
||||
"打包应用无法正常使用 shizuku 模块的问题 _[`issue #227`](http://issues.autojs6.com/227)_ _[`issue #231`](http://issues.autojs6.com/231)_ _[`issue #284`](http://issues.autojs6.com/284)_ _[`issue #287`](http://issues.autojs6.com/287)_ _[`issue #304`](http://issues.autojs6.com/304)_" ,
|
||||
"打包应用无法正常使用 shizuku 模块的问题 _[`issue #227`](http://issues.autojs6.com/227)_ _[`issue #231`](http://issues.autojs6.com/231)_ _[`issue #284`](http://issues.autojs6.com/284)_ _[`issue #287`](http://issues.autojs6.com/287)_ _[`issue #304`](http://issues.autojs6.com/304)_",
|
||||
"代码编辑器跳转到行尾时可能跳转到下一行起始位置的问题",
|
||||
"设置页面连续快速点击对话框类型项目时可能导致应用崩溃的问题"
|
||||
],
|
||||
|
||||
@@ -25,7 +25,7 @@ class WebViewUtils {
|
||||
// ! - For Android API Level >= 29 (10) [Q]:
|
||||
// ! - Android System WebView (or browsers like Google Chrome) version >= 76
|
||||
// ! - For Android API Level <= 28 (9) [P]:
|
||||
// ! - Android System WebView (or browsers like Google Chrome) version >= 105
|
||||
// ! - Android System WebView (or similar Google Chrome browsers) version >= 105
|
||||
// ! Reference: https://stackoverflow.com/questions/57449900/letting-webview-on-android-work-with-prefers-color-scheme-dark
|
||||
// ! zh-CN:
|
||||
// ! 当前特性需满足如下要求:
|
||||
@@ -109,7 +109,21 @@ class WebViewUtils {
|
||||
// ! to ensure that content won't be covered by nav bar when scrolling to the end.
|
||||
// ! zh-CN: 注入 JavaScript, 为 body 添加底部 padding, 确保滚动到底部时导航栏不遮挡内容.
|
||||
@Language("JavaScript")
|
||||
val jsCode = """document.body.style.paddingBottom = "${systemBarInsets.bottom}px";"""
|
||||
val jsCode = """
|
||||
(function() {
|
||||
let mainElements = document.querySelectorAll('main > *');
|
||||
if (mainElements.length > 0) {
|
||||
const additionalPadding = ${systemBarInsets.bottom};
|
||||
mainElements.forEach(ele => {
|
||||
const computedStyle = window.getComputedStyle(ele);
|
||||
const currentPadding = parseFloat(computedStyle.paddingBottom) || 0;
|
||||
ele.style.paddingBottom = (currentPadding + additionalPadding) / window.devicePixelRatio + 'px';
|
||||
});
|
||||
} else {
|
||||
document.body.style.paddingBottom = '${systemBarInsets.bottom}px';
|
||||
}
|
||||
})();
|
||||
""".trimIndent()
|
||||
webView.evaluateJavascript(jsCode, null)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user