From eaeeba2b0ae566556a58af1da893acb30e753d54 Mon Sep 17 00:00:00 2001 From: 7015725 Date: Fri, 22 May 2026 04:59:50 +0800 Subject: [PATCH] Fix ToolApp edge strips blocking buttons --- code/th_15_extra.js | 43 +++++++++++++++++++++++++++---------------- manifest.json | 6 +++--- manifest.sig | 2 +- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/code/th_15_extra.js b/code/th_15_extra.js index a8d1eb6..d570ef8 100644 --- a/code/th_15_extra.js +++ b/code/th_15_extra.js @@ -1088,20 +1088,29 @@ FloatBallAppWM.prototype.buildToolAppShell = function(contentView, title, canBac hostLp.setMargins((spec && (spec.isExpandedWidth || spec.isWideWidth)) ? this.dp(4) : this.dp(6), 0, (spec && (spec.isExpandedWidth || spec.isWideWidth)) ? this.dp(4) : this.dp(6), (spec && (spec.isExpandedWidth || spec.isWideWidth)) ? this.dp(4) : this.dp(6)); body.addView(host, hostLp); + // 自定义边缘返回热区会覆盖左右边缘的真实按钮(返回、关闭、添加、保存装扮等)。 + // 默认不再叠加透明触摸层;需要排查预测返回时再显式开启。 try { - var stripW = this.getToolAppBackEdgeWidthPx ? this.getToolAppBackEdgeWidthPx() : this.dp(48); - var leftStrip = this.createToolAppEdgeBackStrip(0); - var leftLp = new android.widget.FrameLayout.LayoutParams(stripW, -1); - leftLp.gravity = android.view.Gravity.START | android.view.Gravity.TOP; - leftLp.topMargin = topBarHeight + this.dp(8); - root.addView(leftStrip, leftLp); - var rightStrip = this.createToolAppEdgeBackStrip(1); - var rightLp = new android.widget.FrameLayout.LayoutParams(stripW, -1); - rightLp.gravity = android.view.Gravity.END | android.view.Gravity.TOP; - rightLp.topMargin = topBarHeight + this.dp(8); - root.addView(rightStrip, rightLp); - this.state.toolAppInnerBackLeftStrip = leftStrip; - this.state.toolAppInnerBackRightStrip = rightStrip; + var enableInnerBackStrip = false; + try { enableInnerBackStrip = (String(this.config.ENABLE_TOOLAPP_INNER_BACK_STRIPS || "false") === "true"); } catch(eCfg) { enableInnerBackStrip = false; } + if (enableInnerBackStrip) { + var stripW = this.getToolAppBackEdgeWidthPx ? this.getToolAppBackEdgeWidthPx() : this.dp(24); + var leftStrip = this.createToolAppEdgeBackStrip(0); + var leftLp = new android.widget.FrameLayout.LayoutParams(stripW, -1); + leftLp.gravity = android.view.Gravity.START | android.view.Gravity.TOP; + leftLp.topMargin = topBarHeight + this.dp(8); + root.addView(leftStrip, leftLp); + var rightStrip = this.createToolAppEdgeBackStrip(1); + var rightLp = new android.widget.FrameLayout.LayoutParams(stripW, -1); + rightLp.gravity = android.view.Gravity.END | android.view.Gravity.TOP; + rightLp.topMargin = topBarHeight + this.dp(8); + root.addView(rightStrip, rightLp); + this.state.toolAppInnerBackLeftStrip = leftStrip; + this.state.toolAppInnerBackRightStrip = rightStrip; + } else { + this.state.toolAppInnerBackLeftStrip = null; + this.state.toolAppInnerBackRightStrip = null; + } } catch (eStrip) { safeLog(this.L, 'w', "add edge back strip fail: " + String(eStrip)); } this.state.toolAppRoot = root; @@ -1277,10 +1286,12 @@ FloatBallAppWM.prototype.showToolApp = function(route, resetStack) { } catch (eUpd) { safeLog(this.L, 'w', "tool_app update layout fail: " + String(eUpd)); } try { shell.requestFocus(); } catch (eFocus) {} } - // 竖屏系统边缘 predictive back 在 overlay/Rhino 下可能只能收到最终回调;保留窄屏幕边缘 fallback, - // 复用现有 ToolApp 返回预览栈,拖动时实时露出上一级 UI。宽度由 TOOLAPP_BACK_EDGE_WIDTH_DP 控制,默认 22dp。 + // 不再默认添加屏幕边缘透明覆盖层:它会抢占 ToolApp 顶栏/内容区左右边缘按钮的触摸。 + // 如需临时排查返回手势,可把 ENABLE_TOOLAPP_SCREEN_BACK_STRIPS 设为字符串 "true"。 try { - if (this.hasToolAppBackTarget && this.hasToolAppBackTarget()) this.showToolAppScreenBackStrips(); + var enableScreenBackStrip = false; + try { enableScreenBackStrip = (String(this.config.ENABLE_TOOLAPP_SCREEN_BACK_STRIPS || "false") === "true"); } catch(eCfg2) { enableScreenBackStrip = false; } + if (enableScreenBackStrip && this.hasToolAppBackTarget && this.hasToolAppBackTarget()) this.showToolAppScreenBackStrips(); else this.hideToolAppScreenBackStrips(); } catch (eScreenBack) { safeLog(this.L, 'w', "screen edge back strip update fail: " + String(eScreenBack)); } } catch (e) { diff --git a/manifest.json b/manifest.json index a98bd84..5209eb7 100644 --- a/manifest.json +++ b/manifest.json @@ -58,8 +58,8 @@ "size": 294962 }, "th_15_extra.js": { - "sha256": "5084f4db1afd0e681fbdf291adbc10df44eccb43775e86ed1cbe0b8f0e49a25a", - "size": 105271 + "sha256": "11294f672edc0cf85cc662211d73a234301c252f2fa062e8c4b52a2cd3fd8c74", + "size": 106043 }, "th_16_entry.js": { "sha256": "6c59d9891cd010647f84c3db93f1cf95c7bbfb758470ea21044bf72eb8ff73d1", @@ -68,5 +68,5 @@ }, "keyId": "toolhub-targets-2026-rsa3072", "schema": 2, - "version": 20260521204038 + "version": 20260521205945 } diff --git a/manifest.sig b/manifest.sig index eb7e5ca..8f16008 100644 --- a/manifest.sig +++ b/manifest.sig @@ -1 +1 @@ -XJPl0OJwoiPUCu5a2JUmaeaAW4j1Eet5CNOW8jFBom4DtoIbpavxvk8nIub1QkDnPX71reXt8nfspunPp+tFfe/f5hL5+zw9FCerduSA9fWsDz6GzimXe2iywSWzlI/XMHModCAA+HQnNmuYuR+YdjI295uAG7f972+Ecyd6J91JJzx0DbQww3FuvxmmDZW1MyFBkQbyIolJUrvhuNnaCZGEDCnO5KKnXmYguoPQ2HwbYFQ/o7YWJtaAbdqbwQ9TLeRFxKm7eiXRIKzT1PgrMfd+AJcTizfugBhv5EV4EgDtWN6hoRF+0TXIZ3PEhdxUoDrcuxivJ/IisP+MtDBH3pgyRlDXMT8osHhiPJnBhcEmydNoLYFDhP6n6g8SQICvUgNgh4PaHEuQ0Fu6kiYjodvQKNgr1hTuvv0VMrNyOcWa8z2c+bx6tIDVPtwa+9wonEgul0Ub1dchmBz0u4L49D0s9IrFbXJGXxsBjIOJ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