fix toolapp inner back edge width setting
This commit is contained in:
@@ -844,7 +844,7 @@ var ConfigManager = {
|
||||
|
||||
{ type: "section", name: "触摸与手势" },
|
||||
{ key: "CLICK_SLOP_DP", name: "点击位移阈值(dp)", type: "int", min: 1, max: 40, step: 1 },
|
||||
{ key: "TOOLAPP_BACK_EDGE_WIDTH_DP", name: "设置页返回边界宽度", type: "int", min: 1, max: 120, step: 1 },
|
||||
{ key: "TOOLAPP_BACK_EDGE_WIDTH_DP", name: "页面内返回边界宽度", type: "int", min: 1, max: 120, step: 1 },
|
||||
{ key: "TOOLAPP_BACK_COMMIT_DISTANCE_DP", name: "设置页返回触发距离", type: "int", min: 1, max: 480, step: 1 },
|
||||
{ key: "TOOLAPP_BACK_PROGRESS_DISTANCE_DP", name: "设置页返回动画距离", type: "int", min: 1, max: 720, step: 1 },
|
||||
{ key: "ENABLE_LONG_PRESS", name: "启用长按", type: "bool" },
|
||||
|
||||
@@ -321,9 +321,8 @@ FloatBallAppWM.prototype.applyImmediateEffectsForKey = function(k) {
|
||||
|
||||
if (k === "TOOLAPP_BACK_EDGE_WIDTH_DP") {
|
||||
try {
|
||||
if (this.state.toolAppActive && this.hideToolAppScreenBackStrips && this.showToolAppScreenBackStrips) {
|
||||
this.hideToolAppScreenBackStrips();
|
||||
this.showToolAppScreenBackStrips();
|
||||
if (this.state.toolAppActive && this.updateToolAppInnerBackEdgeWidth) {
|
||||
this.updateToolAppInnerBackEdgeWidth();
|
||||
}
|
||||
} catch(eBackStrip) {
|
||||
safeLog(this.L, "w", "apply back edge width fail: " + String(eBackStrip));
|
||||
|
||||
@@ -830,6 +830,19 @@ FloatBallAppWM.prototype.hideToolAppScreenBackStrips = function() {
|
||||
} catch (e) { safeLog(this.L, 'w', "hide tool app screen back strips fail: " + String(e)); }
|
||||
};
|
||||
|
||||
FloatBallAppWM.prototype.getToolAppBackEdgeWidthPx = function() {
|
||||
var stripDp = 48;
|
||||
try {
|
||||
stripDp = Number(this.config.TOOLAPP_BACK_EDGE_WIDTH_DP || 48);
|
||||
if (isNaN(stripDp)) stripDp = 48;
|
||||
if (stripDp < 1) stripDp = 1;
|
||||
if (stripDp > 120) stripDp = 120;
|
||||
} catch(e) {
|
||||
stripDp = 48;
|
||||
}
|
||||
return this.dp(stripDp);
|
||||
};
|
||||
|
||||
FloatBallAppWM.prototype.showToolAppScreenBackStrips = function() {
|
||||
try {
|
||||
if (!this.state.wm || !this.state.toolAppActive) return false;
|
||||
@@ -961,7 +974,7 @@ FloatBallAppWM.prototype.buildToolAppShell = function(contentView, title, canBac
|
||||
body.addView(host, hostLp);
|
||||
|
||||
try {
|
||||
var stripW = this.dp(48);
|
||||
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;
|
||||
@@ -970,6 +983,8 @@ FloatBallAppWM.prototype.buildToolAppShell = function(contentView, title, canBac
|
||||
var rightLp = new android.widget.FrameLayout.LayoutParams(stripW, -1);
|
||||
rightLp.gravity = android.view.Gravity.END | android.view.Gravity.TOP;
|
||||
root.addView(rightStrip, rightLp);
|
||||
this.state.toolAppInnerBackLeftStrip = leftStrip;
|
||||
this.state.toolAppInnerBackRightStrip = rightStrip;
|
||||
} catch (eStrip) { safeLog(this.L, 'w', "add edge back strip fail: " + String(eStrip)); }
|
||||
|
||||
this.state.toolAppRoot = root;
|
||||
@@ -982,6 +997,36 @@ FloatBallAppWM.prototype.buildToolAppShell = function(contentView, title, canBac
|
||||
return root;
|
||||
};
|
||||
|
||||
FloatBallAppWM.prototype.updateToolAppInnerBackEdgeWidth = function() {
|
||||
try {
|
||||
var w = this.getToolAppBackEdgeWidthPx ? this.getToolAppBackEdgeWidthPx() : this.dp(48);
|
||||
|
||||
var left = this.state.toolAppInnerBackLeftStrip;
|
||||
var right = this.state.toolAppInnerBackRightStrip;
|
||||
|
||||
if (left) {
|
||||
var lpL = left.getLayoutParams();
|
||||
if (lpL) {
|
||||
lpL.width = w;
|
||||
left.setLayoutParams(lpL);
|
||||
}
|
||||
}
|
||||
|
||||
if (right) {
|
||||
var lpR = right.getLayoutParams();
|
||||
if (lpR) {
|
||||
lpR.width = w;
|
||||
right.setLayoutParams(lpR);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch(e) {
|
||||
safeLog(this.L, "w", "update inner back edge width fail: " + String(e));
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
FloatBallAppWM.prototype.ensureToolAppShell = function() {
|
||||
try {
|
||||
if (this.state.toolAppRoot && this.state.toolAppContentHost) return this.state.toolAppRoot;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"alg": "SHA256withRSA",
|
||||
"files": {
|
||||
"th_01_base.js": {
|
||||
"sha256": "6066fdd266c85adb6b2ca2168845fb4618f952256fcc3aeb1f133160b505fa15",
|
||||
"sha256": "ea06cb734ad4ccdcec06d746771f6e3c71154d1acf02192edd2b9664109a8e31",
|
||||
"size": 55958
|
||||
},
|
||||
"th_02_core.js": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"size": 40227
|
||||
},
|
||||
"th_05_persistence.js": {
|
||||
"sha256": "a8b8e8e34600c70c710f906c832e9ca48c609f2257700b43b313753ce0603b49",
|
||||
"size": 15231
|
||||
"sha256": "7d913b2caddf04c41ca13023c06763c03a7e372bb31080af37e7a3b2aa81d5f8",
|
||||
"size": 15157
|
||||
},
|
||||
"th_06_icon_parser.js": {
|
||||
"sha256": "25b95a5df634a7ee359f3ab798e4d3154a71c24016f7b4bf8a658096644b2484",
|
||||
@@ -58,8 +58,8 @@
|
||||
"size": 262019
|
||||
},
|
||||
"th_15_extra.js": {
|
||||
"sha256": "b927a12da2a2c71099ca166d838cf982a4c0420ce47301ec5fa3da58047a5c97",
|
||||
"size": 96064
|
||||
"sha256": "bf28b503ea5e2f023952016a57a421ecc8f8ff57844f39571f01ca18ebbcdad4",
|
||||
"size": 97293
|
||||
},
|
||||
"th_16_entry.js": {
|
||||
"sha256": "e7c99c3dfbd6aedab05551426955081ae6cae034754f2f557cefa01dc75dc001",
|
||||
@@ -68,5 +68,5 @@
|
||||
},
|
||||
"keyId": "toolhub-targets-2026-rsa3072",
|
||||
"schema": 2,
|
||||
"version": 20260518164547
|
||||
"version": 20260518170217
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
KaDfDzHxHnW41gnd+x+uamSg0x1kQYMZKRCLgUMnOwFksc08+vq06eI+ElnZP7vPLXVEoo+avqjh7fxC4z1hIYfRvhWyhcHJ1NCaKjmdRgsORXGOP17YFnzS389Xk3hgPlidJU3VLhDgEUEa1Q2Wt4nQ+7fXZY1Lw4SUBU2Ovk02u9eIOxXPmEJ9lOnnuXS9OfiwOpwS7HKeVQQmPiBb0VPaQYeRBojYVCVgp6kCNedvpsyw1rd25oXPUOaJkvvDc1qKO7P+yGrI8QUe3e4bzFcXT555C6op6RBk5mEVsvlq0dZKZoK63BqCrQHQAoDzAONdJ0zPV+jjpb+P0sqK1ztMlupOJJN21C6EdaibHQ3ZcnV4Tep281z5+9wpiSgx5CbIvT10gjIJ+lJaT8yFQA14IkqoL2nyKccsPoLfBIqA9KrSiaK9COrRbvCMbBUMa0KgVELoBfb3puXBqczRD/wxXfQPmZFVWDucq0sW/sCt5F73JC/gUXcpmuVTFJeH
|
||||
auvFOg4qSLMH+ut6SdgXK8I8smXZZfdI00iUQbFrf7pWIJz/mCzNBJf4DO4B5jn4Xf/TWyNHx956nGPnW9hYc79hehc217udD1f0xuWgoLynMRMqgwKKAd+pSz6gZ6zHZtkr/VXsjROBpoXJ8Z5ei2NHbxbPhYJssF2OLSoznhWYHOLENgWjul6M8zBrEn63GfyYp04p2kmXr6EeHyvK4qMSUmC9wfjgfBnKFt/LJcUsQaS1ZeZsJ7h95IC1vPymDfhcxulh/wkiOqRwjKyGJhWD1ChfEMH8+A9RowG2DTZv4tetvmr4xlXiL//MJDdW9wSH7u8oIkH+2oKni0XWIP3egMcATE/wkIOEQEgyJZiC/pnxpuYqZzOjHIsud7xyDlCbouFyAbEoZ1h1YZTCFbl93Y4Kn2pXigfa7YJoCtJRskqInGCY8Kpggi10XK1OMU8b9r3h33cBUwQyQpa22q8FqQQEDX4lsGq5oj6kFZJMf1i7DKzKKMwSX+PVTTTc
|
||||
|
||||
Reference in New Issue
Block a user