feat: show settings save status

This commit is contained in:
7015725
2026-05-18 14:03:36 +08:00
parent eff53e4156
commit c7705348b4
3 changed files with 28 additions and 15 deletions

View File

@@ -231,13 +231,26 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
var dashLp = new android.widget.LinearLayout.LayoutParams(-1, this.dp(92));
dashLp.setMargins(0, this.dp(6), 0, this.dp(12));
var totalButtons = 0;
var enabledButtons = 0;
var statusLabel = "已保存";
var statusValue = "当前生效";
var statusBg = T.card;
var statusStroke = T.stroke;
var statusValueColor = T.text;
try {
var btns = (this.state.pendingUserCfg && this.state.pendingUserCfg.buttons) || this.config.buttons || [];
totalButtons = btns.length || 0;
for (var bi = 0; bi < totalButtons; bi++) { if (!btns[bi] || btns[bi].enabled !== false) enabledButtons++; }
} catch(eCount) {}
if (this.state.previewMode) {
statusLabel = "预览中";
statusValue = "未保存";
statusBg = T.primarySoft;
statusStroke = T.primaryDeep;
statusValueColor = T.primaryDeep;
} else if (this.state.pendingDirty) {
statusLabel = "有修改";
statusValue = "待保存";
statusBg = T.primarySoft;
statusStroke = T.primaryDeep;
statusValueColor = T.primaryDeep;
}
} catch(eStatus) {}
var titleCard = new android.widget.LinearLayout(context);
titleCard.setOrientation(android.widget.LinearLayout.VERTICAL);
@@ -265,17 +278,17 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
statCard.setOrientation(android.widget.LinearLayout.VERTICAL);
statCard.setGravity(android.view.Gravity.CENTER);
statCard.setPadding(this.dp(10), 0, this.dp(10), 0);
statCard.setBackground(this.ui.createStrokeDrawable(T.primarySoft, this.withAlpha(T.primaryDeep, isDark ? 0.34 : 0.24), this.dp(1), this.dp(20)));
statCard.setBackground(this.ui.createStrokeDrawable(statusBg, this.withAlpha(statusStroke, isDark ? 0.34 : 0.24), this.dp(1), this.dp(20)));
var statLabel = new android.widget.TextView(context);
statLabel.setText("已启用 / 全部");
statLabel.setText(statusLabel);
statLabel.setTextColor(T.sub);
statLabel.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12);
statLabel.setGravity(android.view.Gravity.CENTER);
statCard.addView(statLabel, new android.widget.LinearLayout.LayoutParams(-1, -2));
var statVal = new android.widget.TextView(context);
statVal.setText(String(enabledButtons) + " / " + String(totalButtons));
statVal.setTextColor(T.text);
statVal.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 25);
statVal.setText(statusValue);
statVal.setTextColor(statusValueColor);
statVal.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 20);
statVal.setTypeface(null, android.graphics.Typeface.BOLD);
statVal.setGravity(android.view.Gravity.CENTER);
statCard.addView(statVal, new android.widget.LinearLayout.LayoutParams(-1, -2));

View File

@@ -54,8 +54,8 @@
"size": 21198
},
"th_14_panels.js": {
"sha256": "7b8e60d9f1467c909d9d6de8f776715c73ff41b625bce77c0c8c4514fd653611",
"size": 248639
"sha256": "37e15736ce91cdecf419eecfd7637bad6981c40738e66f995ffa0b437daea7bc",
"size": 248871
},
"th_15_extra.js": {
"sha256": "b607620f1900c1bd93ccbec8d901d4de53b3d36e9373877f4264442f79b9b956",
@@ -68,5 +68,5 @@
},
"keyId": "toolhub-targets-2026-rsa3072",
"schema": 2,
"version": 20260518055238
"version": 20260518060114
}

View File

@@ -1 +1 @@
cTkK9cHf20yLd5l0w16g/qounXtIVi+XYKu0u4XBIS5GnutBQOzKa5Tkuml+AU+1yhKDQUO3d266tUYOMw1sn/jpiivB2w8td55ERoPOrAmNwJ/IvEHgZ60NQdR9PHNmpmvFkRQDhns0hS1d8eEE3AWf6cFFVjBG9iC98OTmLdJMC4MqGjtYalq1dfZFelXFM4oCL5RxcOB2FHf8trG+v44Fdw8olAveDx1aFtFD43VHabANDkwRnhfVhVNGL54QN/Gozf3QYA+IdQDPG6vq0i9MwBXjDAYybBY/edl33oZ68Aj0CbUP+hkhdVh7+OWbOCcHFrnBzW40Nbn1HGjv81B6XkLGC3srYtY/0bXdyiZJvLNHQocK4w2aVv7EaJUNJhtE8liVvTHuqgveKx428ZioJclDcNp7TOPxQ1up0bab5aDQcKAOQ6ITmTLAghDtBAnPsjviprqYulM1MhBe5VMLpVyw6xPAFK6s/b4gJpWVDsK/oiZnlb5EDvut3Usx
Esv3uT/9XnxhPSbny8yQLcDZBx4RGkKRLCrJTKO44KUj90qfknpsYy7nO1Amg2nnn5RzaJz4zbUcXDU1QG5EG6vXkURxuPtLAn7eHPR8uG3GAX7d+bDtw/uvo5A74VqpncgoBM2jVCTPqq/VKd71EAqpqzLiosF7J1tQM3LBZLq3t/riDwLiwZgXGk2MVYgR2r8Hl+Pon1OhiyPR/NI8gPxZY4W1Z/nBV/qixHjwrtj5aSHGIeLU1BCLOB4xISJ+eb6jxtPRxXPEkX50G37Xsi7GqSXx78GB2B1WEwIdKcYispzrCoDO99d2Ymo40+aFpL1r8kfZapJ9dugnILVv094SAG06/XgaLzIeUMot7r3OLZseEo0QVhClFtwVDapoFBMnRRsy8HyQZtUnIIBohjPkVVeJ7hoW63QNEBLK/h4kL53SXAVGdkg5VU2EFQwYc27qp/S6uwK/tOvbOkjlCUSA1vBBtZpVnAycjLUEXvvO4GKzYO37caRPNbKkHH4Z