fix: keep button manager footer visible

This commit is contained in:
7015725
2026-05-13 08:27:51 +08:00
parent e9b6052c6a
commit a5ecbec23b
4 changed files with 19 additions and 28 deletions

View File

@@ -1022,21 +1022,9 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
} }
scroll.addView(list); scroll.addView(list);
// # 列表高度优化:限制"按钮管理列表"高度,避免列表区域过高导致底部操作区被顶到很下面 // 列表页采用固定底栏:滚动区吃掉剩余高度,避免“取消更改/保存所有”被挤到屏幕外。
// # 说明:原先使用 weight=1 会占满剩余空间,在不同机型上会显得"列表太高";这里改为按屏幕高度自适应,并限制上下界 var scrollLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, 0);
var scrollLp; scrollLp.weight = 1;
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));
}
scroll.setLayoutParams(scrollLp); scroll.setLayoutParams(scrollLp);
panel.addView(scroll); panel.addView(scroll);
@@ -1064,12 +1052,10 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
self.toast("已取消更改"); self.toast("已取消更改");
self.hideAllPanels(); self.hideAllPanels();
}); });
bottomBar.addView(btnListCancel); var btnListCancelLp = new android.widget.LinearLayout.LayoutParams(0, self.dp(44));
btnListCancelLp.weight = 1;
// 间隔 btnListCancelLp.rightMargin = self.dp(8);
var space = new android.view.View(context); bottomBar.addView(btnListCancel, btnListCancelLp);
space.setLayoutParams(new android.widget.LinearLayout.LayoutParams(self.dp(12), 1));
bottomBar.addView(space);
var btnListSave = self.ui.createSolidButton(self, "保存所有", C.primary, android.graphics.Color.WHITE, function() { var btnListSave = self.ui.createSolidButton(self, "保存所有", C.primary, android.graphics.Color.WHITE, function() {
try { try {
@@ -1080,9 +1066,13 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
refreshPanel(); refreshPanel();
} catch(e) { self.toast("保存失败:" + e); } } 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 { } else {
// --- 编辑模式 --- // --- 编辑模式 ---

View File

@@ -54,8 +54,8 @@
"size": 20386 "size": 20386
}, },
"th_14_panels.js": { "th_14_panels.js": {
"sha256": "7c895dd1cfbb2524b9d60bc442c329a553efbaa5d5067192991f00a22e94b6a3", "sha256": "191b0b61534db05a27474f4aaec9a6e16b1a0aa4f01dfd519036ba3deb0a59de",
"size": 239551 "size": 239224
}, },
"th_15_extra.js": { "th_15_extra.js": {
"sha256": "44d19f0012f4182b9f9831d4f5a747b43d3b726f98e0480e6c79f54eeff70a5e", "sha256": "44d19f0012f4182b9f9831d4f5a747b43d3b726f98e0480e6c79f54eeff70a5e",
@@ -68,5 +68,5 @@
}, },
"keyId": "toolhub-targets-2026-rsa3072", "keyId": "toolhub-targets-2026-rsa3072",
"schema": 2, "schema": 2,
"version": 20260513002103 "version": 20260513002736
} }

View File

@@ -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

View File

@@ -13,7 +13,8 @@ checks = [
("manager no false long-press sort text", "长按卡片排序" not in text), ("manager no false long-press sort text", "长按卡片排序" not in text),
("manager no homepage block text", "按钮管理首页" not in text), ("manager no homepage block text", "按钮管理首页" not in text),
("manager header count only", "\" + buttons.length + \" 个按钮" 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 no useless workbench", "按钮编辑工作台" not in text and "createButtonEditorHeroCard" not in text),
("editor has field spacing helper", "addButtonEditorField" 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), ("editor fixed footer has equal buttons", "btnCancelLp.weight = 1" in text and "btnSaveLp.weight = 1" in text and "self.dp(44)" in text),