6.6.3 - Alpha5 - 修复文档活动页面显示在线文档时部分内容被系统导航栏遮挡的问题
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
"webview 元素支持基于 JsBridge 的 Web 页面布局 (Ref to [Auto.js Pro](https://g.pro.autojs.org/)) [参阅 示例代码 > 布局 > 可交互 HTML / Vue2 + Vant (SFC)] _[`issue #281`](http://issues.autojs6.com/281)_"
|
"webview 元素支持基于 JsBridge 的 Web 页面布局 (Ref to [Auto.js Pro](https://g.pro.autojs.org/)) [参阅 示例代码 > 布局 > 可交互 HTML / Vue2 + Vant (SFC)] _[`issue #281`](http://issues.autojs6.com/281)_"
|
||||||
],
|
],
|
||||||
"fix": [
|
"fix": [
|
||||||
"主页文档标签显示在线文档时部分内容被系统导航栏遮挡的问题",
|
"主页文档标签及文档活动页面显示在线文档时部分内容被系统导航栏遮挡的问题",
|
||||||
"部分设备代码编辑器空行显示方框字符的问题",
|
"部分设备代码编辑器空行显示方框字符的问题",
|
||||||
"主题色设置页面调色盘对话框可能无限叠加的问题",
|
"主题色设置页面调色盘对话框可能无限叠加的问题",
|
||||||
"无障碍服务关闭时音量加键停止所有脚本功能失效的问题",
|
"无障碍服务关闭时音量加键停止所有脚本功能失效的问题",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.autojs.autojs.util.DocsUtils.getUrl
|
|||||||
import org.autojs.autojs.util.ViewUtils
|
import org.autojs.autojs.util.ViewUtils
|
||||||
import org.autojs.autojs.util.WebViewUtils
|
import org.autojs.autojs.util.WebViewUtils
|
||||||
import org.autojs.autojs6.databinding.ActivityDocumentationBinding
|
import org.autojs.autojs6.databinding.ActivityDocumentationBinding
|
||||||
|
import org.intellij.lang.annotations.Language
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Stardust on Oct 24, 2017.
|
* Created by Stardust on Oct 24, 2017.
|
||||||
@@ -31,7 +32,9 @@ class DocumentationActivity : BaseActivity() {
|
|||||||
if (ViewUtils.isNightModeYes(this)) {
|
if (ViewUtils.isNightModeYes(this)) {
|
||||||
WebViewUtils.adaptDarkMode(webView)
|
WebViewUtils.adaptDarkMode(webView)
|
||||||
}
|
}
|
||||||
WebViewUtils.excludeWebViewFromStatusBarAndNavigationBar(ewebView, webView)
|
WebViewUtils.excludeWebViewFromStatusBarAndNavigationBar(ewebView, webView) {
|
||||||
|
generateInjectCodeForBottomInsets(it)
|
||||||
|
}
|
||||||
webView.loadUrl(intent.getStringExtra(EXTRA_URL) ?: getUrl("index.html"))
|
webView.loadUrl(intent.getStringExtra(EXTRA_URL) ?: getUrl("index.html"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,6 +60,26 @@ class DocumentationActivity : BaseActivity() {
|
|||||||
|
|
||||||
const val EXTRA_URL = "url"
|
const val EXTRA_URL = "url"
|
||||||
|
|
||||||
|
fun generateInjectCodeForBottomInsets(systemBarInsetsBottom: Int): String {
|
||||||
|
@Language("JavaScript")
|
||||||
|
val injectCode = """
|
||||||
|
(function() {
|
||||||
|
let mainElements = document.querySelectorAll('main > *');
|
||||||
|
if (mainElements.length > 0) {
|
||||||
|
// Online docs (zh-CN: 在线文档)
|
||||||
|
mainElements.forEach(ele => {
|
||||||
|
let basePaddingBottom = ele.className === 'sidebar-toggle' ? 10 : 0;
|
||||||
|
ele.style.paddingBottom = (basePaddingBottom + ${systemBarInsetsBottom}) / window.devicePixelRatio + 'px';
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Local docs (zh-CN: 本地文档)
|
||||||
|
document.body.style.paddingBottom = '${systemBarInsetsBottom}px';
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
""".trimIndent()
|
||||||
|
return injectCode
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@ import android.webkit.WebView
|
|||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
import com.google.android.material.tabs.TabLayout
|
import com.google.android.material.tabs.TabLayout
|
||||||
import org.autojs.autojs.event.BackPressedHandler
|
import org.autojs.autojs.event.BackPressedHandler
|
||||||
|
import org.autojs.autojs.ui.doc.DocumentationActivity.Companion.generateInjectCodeForBottomInsets
|
||||||
import org.autojs.autojs.ui.fragment.BindingDelegates.viewBinding
|
import org.autojs.autojs.ui.fragment.BindingDelegates.viewBinding
|
||||||
import org.autojs.autojs.ui.main.MainActivity
|
import org.autojs.autojs.ui.main.MainActivity
|
||||||
import org.autojs.autojs.ui.main.QueryEvent
|
import org.autojs.autojs.ui.main.QueryEvent
|
||||||
@@ -21,7 +22,6 @@ import org.autojs.autojs6.R
|
|||||||
import org.autojs.autojs6.databinding.FragmentOnlineDocsBinding
|
import org.autojs.autojs6.databinding.FragmentOnlineDocsBinding
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import org.intellij.lang.annotations.Language
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Stardust on Aug 22, 2017.
|
* Created by Stardust on Aug 22, 2017.
|
||||||
@@ -60,24 +60,8 @@ class DocumentationFragment : ViewPagerFragment(ROTATION_GONE), BackPressedHandl
|
|||||||
if (ViewUtils.isNightModeYes(requireContext())) {
|
if (ViewUtils.isNightModeYes(requireContext())) {
|
||||||
WebViewUtils.adaptDarkMode(webView)
|
WebViewUtils.adaptDarkMode(webView)
|
||||||
}
|
}
|
||||||
WebViewUtils.excludeWebViewFromNavigationBar(ewebView, webView) { systemBarInsetsBottom ->
|
WebViewUtils.excludeWebViewFromNavigationBar(ewebView, webView) {
|
||||||
@Language("JavaScript")
|
generateInjectCodeForBottomInsets(it)
|
||||||
val injectCode = """
|
|
||||||
(function() {
|
|
||||||
let mainElements = document.querySelectorAll('main > *');
|
|
||||||
if (mainElements.length > 0) {
|
|
||||||
// Online docs (zh-CN: 在线文档)
|
|
||||||
mainElements.forEach(ele => {
|
|
||||||
let basePaddingBottom = ele.className === 'sidebar-toggle' ? 10 : 0;
|
|
||||||
ele.style.paddingBottom = (basePaddingBottom + ${systemBarInsetsBottom}) / window.devicePixelRatio + 'px';
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Local docs (zh-CN: 本地文档)
|
|
||||||
document.body.style.paddingBottom = '${systemBarInsetsBottom}px';
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
""".trimIndent()
|
|
||||||
injectCode
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ class WebViewUtils {
|
|||||||
excludeWebViewFromSystemBars(webViewWrapper, webView, excludeStatusBar = true, excludeNavigationBar = true)
|
excludeWebViewFromSystemBars(webViewWrapper, webView, excludeStatusBar = true, excludeNavigationBar = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun excludeWebViewFromStatusBarAndNavigationBar(webViewWrapper: View, webView: WebView, excludeNavigationBarInjectCode: (systemBarInsetsBottom: Int) -> String) {
|
||||||
|
excludeWebViewFromSystemBars(webViewWrapper, webView, excludeStatusBar = true, excludeNavigationBarInjectCode = excludeNavigationBarInjectCode)
|
||||||
|
}
|
||||||
|
|
||||||
private fun excludeWebViewFromSystemBars(webViewWrapper: View, webView: WebView, excludeStatusBar: Boolean, excludeNavigationBarInjectCode: (systemBarInsetsBottom: Int) -> String) {
|
private fun excludeWebViewFromSystemBars(webViewWrapper: View, webView: WebView, excludeStatusBar: Boolean, excludeNavigationBarInjectCode: (systemBarInsetsBottom: Int) -> String) {
|
||||||
var mSystemBarInsets: Insets? = null
|
var mSystemBarInsets: Insets? = null
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(webViewWrapper) { v, insets ->
|
ViewCompat.setOnApplyWindowInsetsListener(webViewWrapper) { v, insets ->
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#Sun May 25 23:31:03 CST 2025
|
#Mon May 26 00:57:45 CST 2025
|
||||||
BUILD_TIME=1748187063682
|
BUILD_TIME=1748192265701
|
||||||
COMPILE_SDK_VERSION=35
|
COMPILE_SDK_VERSION=35
|
||||||
IMAGE_QUANT_CMAKE_VERSION=3.22.1
|
IMAGE_QUANT_CMAKE_VERSION=3.22.1
|
||||||
IMAGE_QUANT_NDK_VERSION=26.1.10909125
|
IMAGE_QUANT_NDK_VERSION=26.1.10909125
|
||||||
@@ -19,6 +19,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13
|
|||||||
RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3
|
RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3
|
||||||
TARGET_SDK_VERSION=35
|
TARGET_SDK_VERSION=35
|
||||||
TARGET_SDK_VERSION_INRT=29
|
TARGET_SDK_VERSION_INRT=29
|
||||||
VERSION_BUILD=3255
|
VERSION_BUILD=3256
|
||||||
VERSION_NAME=6.6.3 Alpha5
|
VERSION_NAME=6.6.3 Alpha5
|
||||||
VSCODE_EXT_REQUIRED_VERSION=1.0.8
|
VSCODE_EXT_REQUIRED_VERSION=1.0.8
|
||||||
|
|||||||
Reference in New Issue
Block a user