diff --git a/code/th_14_panels.js b/code/th_14_panels.js index c5a9c7e..01ced38 100644 --- a/code/th_14_panels.js +++ b/code/th_14_panels.js @@ -1022,21 +1022,9 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() { } scroll.addView(list); - // # 列表高度优化:限制"按钮管理列表"高度,避免列表区域过高导致底部操作区被顶到很下面 - // # 说明:原先使用 weight=1 会占满剩余空间,在不同机型上会显得"列表太高";这里改为按屏幕高度自适应,并限制上下界 - var scrollLp; - try { - var dm2 = context.getResources().getDisplayMetrics(); - var hPx2 = dm2 ? dm2.heightPixels : 0; - var targetPx2 = hPx2 > 0 ? Math.floor(hPx2 * 0.55) : self.dp(360); - var minPx2 = self.dp(220); - var maxPx2 = self.dp(520); - if (targetPx2 < minPx2) targetPx2 = minPx2; - if (targetPx2 > maxPx2) targetPx2 = maxPx2; - scrollLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, targetPx2); - } catch(eScrollH) { - scrollLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, self.dp(360)); - } + // 列表页采用固定底栏:滚动区吃掉剩余高度,避免“取消更改/保存所有”被挤到屏幕外。 + var scrollLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, 0); + scrollLp.weight = 1; scroll.setLayoutParams(scrollLp); panel.addView(scroll); @@ -1064,12 +1052,10 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() { self.toast("已取消更改"); self.hideAllPanels(); }); - bottomBar.addView(btnListCancel); - - // 间隔 - var space = new android.view.View(context); - space.setLayoutParams(new android.widget.LinearLayout.LayoutParams(self.dp(12), 1)); - bottomBar.addView(space); + var btnListCancelLp = new android.widget.LinearLayout.LayoutParams(0, self.dp(44)); + btnListCancelLp.weight = 1; + btnListCancelLp.rightMargin = self.dp(8); + bottomBar.addView(btnListCancel, btnListCancelLp); var btnListSave = self.ui.createSolidButton(self, "保存所有", C.primary, android.graphics.Color.WHITE, function() { try { @@ -1080,9 +1066,13 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() { refreshPanel(); } catch(e) { self.toast("保存失败:" + e); } }); - bottomBar.addView(btnListSave); + var btnListSaveLp = new android.widget.LinearLayout.LayoutParams(0, self.dp(44)); + btnListSaveLp.weight = 1; + bottomBar.addView(btnListSave, btnListSaveLp); - panel.addView(bottomBar); + var listBottomLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT); + listBottomLp.setMargins(0, self.dp(6), 0, 0); + panel.addView(bottomBar, listBottomLp); } else { // --- 编辑模式 --- diff --git a/manifest.json b/manifest.json index 8b3d92a..3fbd16d 100644 --- a/manifest.json +++ b/manifest.json @@ -54,8 +54,8 @@ "size": 20386 }, "th_14_panels.js": { - "sha256": "7c895dd1cfbb2524b9d60bc442c329a553efbaa5d5067192991f00a22e94b6a3", - "size": 239551 + "sha256": "191b0b61534db05a27474f4aaec9a6e16b1a0aa4f01dfd519036ba3deb0a59de", + "size": 239224 }, "th_15_extra.js": { "sha256": "44d19f0012f4182b9f9831d4f5a747b43d3b726f98e0480e6c79f54eeff70a5e", @@ -68,5 +68,5 @@ }, "keyId": "toolhub-targets-2026-rsa3072", "schema": 2, - "version": 20260513002103 + "version": 20260513002736 } diff --git a/manifest.sig b/manifest.sig index c55171e..92e4379 100644 --- a/manifest.sig +++ b/manifest.sig @@ -1 +1 @@ -hEqgzyJCqEHftLOT+w+T0aZOpmhk7HF9p+tSjp4/2bmC5uAkQMEaUXh3dQARGlZgfsZr28oTLxcCh6UcTKaysAoBGnw8ukmhQ/rVuPCnTJ0euJ6zLDZp4kKBcHvK+iSQ2UDJo0VTa1iw5gzRsLJLuV9UI4ufZ55zQeVTFQ6XijsBtKjgVdXvmD0ONZ7DvElAT95Eg5JS18m86F5uw/dlE+KQX9Bb37swwRgP/vi/EAZukUwevPQ7KTTBoBgyBjEyvPkjHhgtlo5I0956uqtQ7bW/hmHLYNdYLehCrd9IgW49UGFgBZvM1+pk7Rqcjh+6BAV4kcUwzmTVE4HkTjMNpQ8dhHgfloAYTV7MQ3L4JagQvGc4wkr3NmBs9FmRJ2p64IAx8bofTC4zR3I2DmfITlWcyAYgY59NzSSiVFKRAFGE82FS9oGYO3u0MKQUFEZrxYg7/QqnA6M4hG/ZQEfkv0hwm4fLeXvioUQJIGNouu4XnRzytKX93mfqho/MPF4x +SNWCr5nq8GcStvfHDiIxw+kll+rU7YmEU8DKynKBp8CiK6Ves2YQdZ31NoTf2b0GWPad/I/xkz1tk9b25cfvW4fi7W+w4FMlFjVHogwcu9M4MPhUF0PLpf23TAoXHmchdQ8mvZahxpHYR/kpW8ss+kTqaByeIp6Y93C+Zje1MRMiWmS36ynODF/0Chrv3QAP1PrRw/oIzin/iw9R9sGG3GLArYPgKcd9nuqsbW3jhC28RAlKySIfuCboFytAU4SlUi83LGd2riDlXnpPVCCELA2YhAE1WKtUoCjKdJX+gffoM8V11GzlkGoIrI3rgxkqcs4R8R6fNnVzQjtbt1IqxSL5AUCqSfSYMJEcZm0b3d8qQ6Wz/+k8Q/7UeqTVuhqVihTn9eKdP09VM531cWKBTAqRMkliknYwi3fWsLRGmXdR0chdrSZVchDa2/snHONIBLVm8i21FzCujVHPRte89Dsg78y3Gug5X+7zvXvQ+14DEFGASfduDXX7kphYsdrL diff --git a/scripts/verify_button_editor_layout.py b/scripts/verify_button_editor_layout.py index 7eb58cd..82a0db5 100644 --- a/scripts/verify_button_editor_layout.py +++ b/scripts/verify_button_editor_layout.py @@ -13,7 +13,8 @@ checks = [ ("manager no false long-press sort text", "长按卡片排序" not in text), ("manager no homepage block text", "按钮管理首页" not in text), ("manager header count only", "共 \" + buttons.length + \" 个按钮" in text), - ("manager card actions are text actions", "createButtonManagerTextAction(\"上移\"" in text and "createButtonManagerTextAction(\"下移\"" in text and "createButtonManagerTextAction(\"删除\"" in text), + ("manager list footer uses remaining-height scroll", "避免“取消更改/保存所有”被挤到屏幕外" in text and "scrollLp.weight = 1" in text), + ("manager list footer has equal buttons", "btnListCancelLp.weight = 1" in text and "btnListSaveLp.weight = 1" in text and "listBottomLp" in text), ("editor no useless workbench", "按钮编辑工作台" not in text and "createButtonEditorHeroCard" not in text), ("editor has field spacing helper", "addButtonEditorField" in text), ("editor fixed footer has equal buttons", "btnCancelLp.weight = 1" in text and "btnSaveLp.weight = 1" in text and "self.dp(44)" in text),