feat: apply animal island style to ToolApp

This commit is contained in:
7015725
2026-05-14 22:28:51 +08:00
parent b9409c9056
commit edb26dc593
5 changed files with 136 additions and 68 deletions

View File

@@ -9,6 +9,61 @@ FloatBallAppWM.prototype.getRotation = function() { try { return this.state.wm.g
// =======================【工具alpha/toast/vibrate】====================== // =======================【工具alpha/toast/vibrate】======================
FloatBallAppWM.prototype.withAlpha = function(colorInt, alpha01) { var a = Math.floor(Number(alpha01) * 255); return (colorInt & 0x00FFFFFF) | (a << 24); }; FloatBallAppWM.prototype.withAlpha = function(colorInt, alpha01) { var a = Math.floor(Number(alpha01) * 255); return (colorInt & 0x00FFFFFF) | (a << 24); };
// Animal Island LiteToolApp 专用视觉主题。只供设置/按钮管理/编辑页调用,避免覆盖悬浮球 Monet 取色。
FloatBallAppWM.prototype.getAnimalIslandTheme = function() {
var isDark = false;
try { isDark = this.isDarkTheme(); } catch(eDark) { isDark = false; }
var Color = android.graphics.Color;
if (isDark) {
return {
bg: Color.parseColor("#1F2E29"),
bg2: Color.parseColor("#263A33"),
leaf: Color.parseColor("#31564A"),
card: Color.parseColor("#2F4037"),
card2: Color.parseColor("#3A4B40"),
cream: Color.parseColor("#FFF4D8"),
text: Color.parseColor("#FFF4D8"),
sub: Color.parseColor("#D8C6A6"),
brown: Color.parseColor("#A9855E"),
primary: Color.parseColor("#62D7C6"),
primaryDeep: Color.parseColor("#19A89A"),
primarySoft: Color.parseColor("#2C5C55"),
danger: Color.parseColor("#F08A86"),
dangerSoft: Color.parseColor("#5A3432"),
stroke: Color.parseColor("#66563F"),
onPrimary: Color.parseColor("#17352F")
};
}
return {
bg: Color.parseColor("#A8DDB4"),
bg2: Color.parseColor("#DDF3D8"),
leaf: Color.parseColor("#7DC395"),
card: Color.parseColor("#FFF9E6"),
card2: Color.parseColor("#FFFFFF"),
cream: Color.parseColor("#FFF9E6"),
text: Color.parseColor("#5E472D"),
sub: Color.parseColor("#7C5734"),
brown: Color.parseColor("#8B643D"),
primary: Color.parseColor("#19C8B9"),
primaryDeep: Color.parseColor("#0E9E91"),
primarySoft: Color.parseColor("#DDF7F2"),
danger: Color.parseColor("#D86962"),
dangerSoft: Color.parseColor("#FFE7E2"),
stroke: Color.parseColor("#E0C79E"),
onPrimary: Color.parseColor("#FFFFFF")
};
};
FloatBallAppWM.prototype.createAnimalCardDrawable = function(fillColor, radiusDp) {
var T = this.getAnimalIslandTheme();
return this.ui.createStrokeDrawable(fillColor || T.card, this.withAlpha(T.stroke, this.isDarkTheme() ? 0.36 : 0.55), this.dp(1), this.dp(radiusDp || 18));
};
FloatBallAppWM.prototype.createAnimalButtonDrawable = function(normalColor, pressedColor, radiusDp) {
return this.ui.createRippleDrawable(normalColor, pressedColor, this.dp(radiusDp || 18));
};
FloatBallAppWM.prototype.toast = function(msg) { try { android.widget.Toast.makeText(context, String(msg), 0).show(); } catch(e) { safeLog(null, 'e', "catch " + String(e)); } }; FloatBallAppWM.prototype.toast = function(msg) { try { android.widget.Toast.makeText(context, String(msg), 0).show(); } catch(e) { safeLog(null, 'e', "catch " + String(e)); } };
FloatBallAppWM.prototype.vibrateOnce = function(ms) { FloatBallAppWM.prototype.vibrateOnce = function(ms) {
if (!this.config.LONG_PRESS_HAPTIC_ENABLE) return; if (!this.config.LONG_PRESS_HAPTIC_ENABLE) return;

View File

@@ -37,15 +37,16 @@ FloatBallAppWM.prototype.createSettingsHomeEntry = function(parent, title, desc,
var self = this; var self = this;
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var cardColor = isDark ? C.cardDark : android.graphics.Color.WHITE; var T = this.getAnimalIslandTheme();
var textColor = isDark ? C.textPriDark : C.textPriLight; var cardColor = T.card;
var subTextColor = isDark ? C.textSecDark : C.textSecLight; var textColor = T.text;
var subTextColor = T.sub;
var row = new android.widget.LinearLayout(context); var row = new android.widget.LinearLayout(context);
row.setOrientation(android.widget.LinearLayout.HORIZONTAL); row.setOrientation(android.widget.LinearLayout.HORIZONTAL);
row.setGravity(android.view.Gravity.CENTER_VERTICAL); row.setGravity(android.view.Gravity.CENTER_VERTICAL);
row.setPadding(this.dp(16), this.dp(14), this.dp(14), this.dp(14)); row.setPadding(this.dp(16), this.dp(14), this.dp(14), this.dp(14));
row.setBackground(this.ui.createRippleDrawable(cardColor, isDark ? this.withAlpha(C.primary, 0.16) : this.withAlpha(C.primary, 0.10), this.dp(18))); row.setBackground(this.ui.createRippleDrawable(cardColor, this.withAlpha(T.primary, isDark ? 0.20 : 0.14), this.dp(20)));
try { row.setElevation(this.dp(3)); } catch(eElev) { safeLog(null, 'e', "catch " + String(eElev)); } try { row.setElevation(this.dp(4)); } catch(eElev) { safeLog(null, 'e', "catch " + String(eElev)); }
var badge = new android.widget.TextView(context); var badge = new android.widget.TextView(context);
var icon = "⚙"; var icon = "⚙";
@@ -57,11 +58,11 @@ FloatBallAppWM.prototype.createSettingsHomeEntry = function(parent, title, desc,
else if (String(title).indexOf("动画") >= 0) icon = "↝"; else if (String(title).indexOf("动画") >= 0) icon = "↝";
else if (String(title).indexOf("日志") >= 0) icon = "⌁"; else if (String(title).indexOf("日志") >= 0) icon = "⌁";
badge.setText(icon); badge.setText(icon);
badge.setTextColor(C.primary); badge.setTextColor(T.primaryDeep);
badge.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 19); badge.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 19);
badge.setGravity(android.view.Gravity.CENTER); badge.setGravity(android.view.Gravity.CENTER);
badge.setTypeface(null, android.graphics.Typeface.BOLD); badge.setTypeface(null, android.graphics.Typeface.BOLD);
badge.setBackground(this.ui.createRoundDrawable(this.withAlpha(C.primary, isDark ? 0.18 : 0.12), this.dp(15))); badge.setBackground(this.ui.createStrokeDrawable(T.primarySoft, this.withAlpha(T.primaryDeep, isDark ? 0.36 : 0.28), this.dp(1), this.dp(16)));
var badgeLp = new android.widget.LinearLayout.LayoutParams(this.dp(46), this.dp(46)); var badgeLp = new android.widget.LinearLayout.LayoutParams(this.dp(46), this.dp(46));
badgeLp.setMargins(0, 0, this.dp(14), 0); badgeLp.setMargins(0, 0, this.dp(14), 0);
row.addView(badge, badgeLp); row.addView(badge, badgeLp);
@@ -87,12 +88,12 @@ FloatBallAppWM.prototype.createSettingsHomeEntry = function(parent, title, desc,
var tvGo = new android.widget.TextView(context); var tvGo = new android.widget.TextView(context);
tvGo.setText(String(actionText || "进入") + " "); tvGo.setText(String(actionText || "进入") + " ");
tvGo.setTextColor(C.primary); tvGo.setTextColor(T.onPrimary);
tvGo.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 13); tvGo.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 13);
tvGo.setTypeface(null, android.graphics.Typeface.BOLD); tvGo.setTypeface(null, android.graphics.Typeface.BOLD);
tvGo.setGravity(android.view.Gravity.CENTER); tvGo.setGravity(android.view.Gravity.CENTER);
tvGo.setPadding(this.dp(10), this.dp(5), this.dp(10), this.dp(5)); tvGo.setPadding(this.dp(10), this.dp(5), this.dp(10), this.dp(5));
tvGo.setBackground(this.ui.createRoundDrawable(this.withAlpha(C.primary, isDark ? 0.16 : 0.10), this.dp(14))); tvGo.setBackground(this.ui.createRippleDrawable(T.primary, T.primaryDeep, this.dp(15)));
row.addView(tvGo); row.addView(tvGo);
row.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(v) { row.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(v) {
try { self.touchActivity(); } catch(eT) {} try { self.touchActivity(); } catch(eT) {}
@@ -108,9 +109,11 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
var self = this; var self = this;
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var bgColor = isDark ? C.bgDark : C.bgLight; var T = this.getAnimalIslandTheme();
var subTextColor = isDark ? C.textSecDark : C.textSecLight; var bgColor = T.bg;
var subTextColor = T.sub;
var panel = this.ui.createStyledPanel(this, 16); var panel = this.ui.createStyledPanel(this, 16);
try { panel.setBackground(this.ui.createRoundDrawable(T.bg, this.dp(18))); } catch(ePanelBg) {}
var quick = new android.widget.LinearLayout(context); var quick = new android.widget.LinearLayout(context);
quick.setOrientation(android.widget.LinearLayout.HORIZONTAL); quick.setOrientation(android.widget.LinearLayout.HORIZONTAL);
@@ -135,7 +138,7 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
quick.addView(memTv); quick.addView(memTv);
quick.addView(this.ui.createSpacer(this)); quick.addView(this.ui.createSpacer(this));
var btnDoc = this.ui.createFlatButton(this, "文档", C.primary, function() { var btnDoc = this.ui.createFlatButton(this, "文档", T.brown, function() {
try { try {
var intent = new android.content.Intent(android.content.Intent.ACTION_VIEW); var intent = new android.content.Intent(android.content.Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse("https://xin-blog.com/114.html")); intent.setData(android.net.Uri.parse("https://xin-blog.com/114.html"));
@@ -145,7 +148,7 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
}); });
quick.addView(btnDoc); quick.addView(btnDoc);
var btnSave = this.ui.createSolidButton(this, "保存", C.primary, android.graphics.Color.WHITE, function() { var btnSave = this.ui.createSolidButton(this, "保存", T.primary, T.onPrimary, function() {
try { try {
self.touchActivity(); self.touchActivity();
var r = self.commitPendingUserCfg(); var r = self.commitPendingUserCfg();
@@ -179,17 +182,17 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
titleCard.setOrientation(android.widget.LinearLayout.VERTICAL); titleCard.setOrientation(android.widget.LinearLayout.VERTICAL);
titleCard.setGravity(android.view.Gravity.CENTER); titleCard.setGravity(android.view.Gravity.CENTER);
titleCard.setPadding(this.dp(12), 0, this.dp(12), 0); titleCard.setPadding(this.dp(12), 0, this.dp(12), 0);
titleCard.setBackground(this.ui.createRoundDrawable(isDark ? this.withAlpha(C.primary, 0.20) : this.withAlpha(C.primary, 0.14), this.dp(18))); titleCard.setBackground(this.ui.createStrokeDrawable(T.card, this.withAlpha(T.stroke, isDark ? 0.34 : 0.55), this.dp(1), this.dp(20)));
var titleMain = new android.widget.TextView(context); var titleMain = new android.widget.TextView(context);
titleMain.setText("ToolHub"); titleMain.setText("ToolHub 岛屿");
titleMain.setTextColor(isDark ? C.textPriDark : C.textPriLight); titleMain.setTextColor(T.text);
titleMain.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 22); titleMain.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 22);
titleMain.setTypeface(null, android.graphics.Typeface.BOLD); titleMain.setTypeface(null, android.graphics.Typeface.BOLD);
titleMain.setGravity(android.view.Gravity.CENTER); titleMain.setGravity(android.view.Gravity.CENTER);
titleCard.addView(titleMain, new android.widget.LinearLayout.LayoutParams(-1, -2)); titleCard.addView(titleMain, new android.widget.LinearLayout.LayoutParams(-1, -2));
var titleSub = new android.widget.TextView(context); var titleSub = new android.widget.TextView(context);
titleSub.setText("悬浮球控制中心"); titleSub.setText("温暖风格控制中心");
titleSub.setTextColor(subTextColor); titleSub.setTextColor(T.sub);
titleSub.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12); titleSub.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12);
titleSub.setGravity(android.view.Gravity.CENTER); titleSub.setGravity(android.view.Gravity.CENTER);
titleCard.addView(titleSub, new android.widget.LinearLayout.LayoutParams(-1, -2)); titleCard.addView(titleSub, new android.widget.LinearLayout.LayoutParams(-1, -2));
@@ -201,16 +204,16 @@ FloatBallAppWM.prototype.buildSettingsHomePanelView = function() {
statCard.setOrientation(android.widget.LinearLayout.VERTICAL); statCard.setOrientation(android.widget.LinearLayout.VERTICAL);
statCard.setGravity(android.view.Gravity.CENTER); statCard.setGravity(android.view.Gravity.CENTER);
statCard.setPadding(this.dp(10), 0, this.dp(10), 0); statCard.setPadding(this.dp(10), 0, this.dp(10), 0);
statCard.setBackground(this.ui.createRoundDrawable(isDark ? C.cardDark : android.graphics.Color.WHITE, this.dp(18))); statCard.setBackground(this.ui.createStrokeDrawable(T.primarySoft, this.withAlpha(T.primaryDeep, isDark ? 0.34 : 0.24), this.dp(1), this.dp(20)));
var statLabel = new android.widget.TextView(context); var statLabel = new android.widget.TextView(context);
statLabel.setText("按钮启用"); statLabel.setText("按钮启用");
statLabel.setTextColor(subTextColor); statLabel.setTextColor(T.sub);
statLabel.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12); statLabel.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12);
statLabel.setGravity(android.view.Gravity.CENTER); statLabel.setGravity(android.view.Gravity.CENTER);
statCard.addView(statLabel, new android.widget.LinearLayout.LayoutParams(-1, -2)); statCard.addView(statLabel, new android.widget.LinearLayout.LayoutParams(-1, -2));
var statVal = new android.widget.TextView(context); var statVal = new android.widget.TextView(context);
statVal.setText(String(enabledButtons) + " / " + String(totalButtons)); statVal.setText(String(enabledButtons) + " / " + String(totalButtons));
statVal.setTextColor(isDark ? C.textPriDark : C.textPriLight); statVal.setTextColor(T.text);
statVal.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 25); statVal.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 25);
statVal.setTypeface(null, android.graphics.Typeface.BOLD); statVal.setTypeface(null, android.graphics.Typeface.BOLD);
statVal.setGravity(android.view.Gravity.CENTER); statVal.setGravity(android.view.Gravity.CENTER);
@@ -589,22 +592,23 @@ FloatBallAppWM.prototype.matchesButtonManagerQuery = function(btnCfg, query) {
FloatBallAppWM.prototype.createButtonManagerSummaryCard = function(parent, totalCount, enabledCount, disabledCount) { FloatBallAppWM.prototype.createButtonManagerSummaryCard = function(parent, totalCount, enabledCount, disabledCount) {
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var T = this.getAnimalIslandTheme();
var card = new android.widget.LinearLayout(context); var card = new android.widget.LinearLayout(context);
card.setOrientation(android.widget.LinearLayout.VERTICAL); card.setOrientation(android.widget.LinearLayout.VERTICAL);
card.setPadding(this.dp(14), this.dp(10), this.dp(14), this.dp(10)); card.setPadding(this.dp(14), this.dp(10), this.dp(14), this.dp(10));
card.setBackground(this.ui.createRoundDrawable(isDark ? this.withAlpha(C.cardDark, 0.88) : this.withAlpha(C.cardLight, 0.92), this.dp(14))); card.setBackground(this.ui.createStrokeDrawable(T.card, this.withAlpha(T.stroke, isDark ? 0.34 : 0.50), this.dp(1), this.dp(18)));
try { card.setElevation(this.dp(2)); } catch(eElev) { safeLog(null, 'e', "catch " + String(eElev)); } try { card.setElevation(this.dp(3)); } catch(eElev) { safeLog(null, 'e', "catch " + String(eElev)); }
var title = new android.widget.TextView(context); var title = new android.widget.TextView(context);
title.setText("按钮统计"); title.setText("按钮统计");
title.setTextColor(isDark ? C.textPriDark : C.textPriLight); title.setTextColor(T.text);
title.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 15); title.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 15);
title.setTypeface(null, android.graphics.Typeface.BOLD); title.setTypeface(null, android.graphics.Typeface.BOLD);
card.addView(title); card.addView(title);
var sub = new android.widget.TextView(context); var sub = new android.widget.TextView(context);
sub.setText("共 " + totalCount + " 个 · 已启用 " + enabledCount + " · 已禁用 " + disabledCount); sub.setText("共 " + totalCount + " 个 · 已启用 " + enabledCount + " · 已禁用 " + disabledCount);
sub.setTextColor(isDark ? C.textSecDark : C.textSecLight); sub.setTextColor(T.sub);
sub.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12); sub.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12);
sub.setPadding(0, this.dp(4), 0, 0); sub.setPadding(0, this.dp(4), 0, 0);
card.addView(sub); card.addView(sub);
@@ -615,6 +619,7 @@ FloatBallAppWM.prototype.createButtonManagerSummaryCard = function(parent, total
}; };
FloatBallAppWM.prototype.createButtonManagerActionChip = function(text, textColor, strokeColor, onClickFn) { FloatBallAppWM.prototype.createButtonManagerActionChip = function(text, textColor, strokeColor, onClickFn) {
var T = this.getAnimalIslandTheme();
var tv = new android.widget.TextView(context); var tv = new android.widget.TextView(context);
tv.setText(String(text || "")); tv.setText(String(text || ""));
tv.setGravity(android.view.Gravity.CENTER); tv.setGravity(android.view.Gravity.CENTER);
@@ -625,10 +630,11 @@ FloatBallAppWM.prototype.createButtonManagerActionChip = function(text, textColo
tv.setPadding(this.dp(10), 0, this.dp(10), 0); tv.setPadding(this.dp(10), 0, this.dp(10), 0);
try { try {
var bg = new android.graphics.drawable.GradientDrawable(); var bg = new android.graphics.drawable.GradientDrawable();
bg.setColor(android.graphics.Color.TRANSPARENT); bg.setColor(this.withAlpha(T.primarySoft, this.isDarkTheme() ? 0.62 : 0.95));
bg.setCornerRadius(this.dp(12)); bg.setCornerRadius(this.dp(14));
bg.setStroke(this.dp(1), strokeColor); bg.setStroke(this.dp(1), strokeColor || this.withAlpha(T.primaryDeep, 0.32));
tv.setBackground(bg); tv.setBackground(bg);
try { tv.setElevation(this.dp(1)); } catch(eElev) {}
} catch(eBg) { safeLog(null, 'e', "catch " + String(eBg)); } } catch(eBg) { safeLog(null, 'e', "catch " + String(eBg)); }
if (onClickFn) { if (onClickFn) {
tv.setOnClickListener(new android.view.View.OnClickListener({ onClick: function() { tv.setOnClickListener(new android.view.View.OnClickListener({ onClick: function() {
@@ -658,25 +664,26 @@ FloatBallAppWM.prototype.createButtonManagerTextAction = function(text, textColo
FloatBallAppWM.prototype.createButtonManagerPolishedCard = function(parent, title, subtitle, statText) { FloatBallAppWM.prototype.createButtonManagerPolishedCard = function(parent, title, subtitle, statText) {
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var T = this.getAnimalIslandTheme();
var card = new android.widget.LinearLayout(context); var card = new android.widget.LinearLayout(context);
card.setOrientation(android.widget.LinearLayout.VERTICAL); card.setOrientation(android.widget.LinearLayout.VERTICAL);
card.setPadding(this.dp(14), this.dp(12), this.dp(14), this.dp(12)); card.setPadding(this.dp(14), this.dp(12), this.dp(14), this.dp(12));
card.setBackground(this.ui.createRoundDrawable(isDark ? this.withAlpha(C.cardDark, 0.74) : this.withAlpha(C.cardLight, 0.78), this.dp(18))); card.setBackground(this.ui.createStrokeDrawable(T.card, this.withAlpha(T.stroke, isDark ? 0.32 : 0.48), this.dp(1), this.dp(20)));
try { card.setElevation(this.dp(2)); } catch(eElev) {} try { card.setElevation(this.dp(3)); } catch(eElev) {}
var tv = new android.widget.TextView(context); var tv = new android.widget.TextView(context);
tv.setText(String(title || "")); tv.setText(String(title || ""));
tv.setTextColor(isDark ? C.textPriDark : C.textPriLight); tv.setTextColor(T.text);
tv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 15); tv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 15);
tv.setTypeface(null, android.graphics.Typeface.BOLD); tv.setTypeface(null, android.graphics.Typeface.BOLD);
card.addView(tv); card.addView(tv);
var sub = new android.widget.TextView(context); var sub = new android.widget.TextView(context);
sub.setText(String(subtitle || "")); sub.setText(String(subtitle || ""));
sub.setTextColor(isDark ? C.textSecDark : C.textSecLight); sub.setTextColor(T.sub);
sub.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12); sub.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12);
sub.setPadding(0, this.dp(4), 0, 0); sub.setPadding(0, this.dp(4), 0, 0);
card.addView(sub); card.addView(sub);
if (statText) { if (statText) {
var chip = this.createButtonManagerActionChip(String(statText), C.primary, this.withAlpha(C.primary, 0.32), null); var chip = this.createButtonManagerActionChip(String(statText), T.primaryDeep, this.withAlpha(T.primaryDeep, 0.32), null);
var chipLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT); var chipLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT);
chipLp.setMargins(0, this.dp(10), 0, 0); chipLp.setMargins(0, this.dp(10), 0, 0);
card.addView(chip, chipLp); card.addView(chip, chipLp);
@@ -700,20 +707,21 @@ FloatBallAppWM.prototype.addButtonEditorField = function(parent, view) {
FloatBallAppWM.prototype.createButtonEditorSectionCard = function(parent, title, desc) { FloatBallAppWM.prototype.createButtonEditorSectionCard = function(parent, title, desc) {
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var T = this.getAnimalIslandTheme();
var box = new android.widget.LinearLayout(context); var box = new android.widget.LinearLayout(context);
box.setOrientation(android.widget.LinearLayout.VERTICAL); box.setOrientation(android.widget.LinearLayout.VERTICAL);
box.setPadding(this.dp(12), this.dp(10), this.dp(12), this.dp(10)); box.setPadding(this.dp(12), this.dp(10), this.dp(12), this.dp(10));
box.setBackground(this.ui.createRoundDrawable(isDark ? this.withAlpha(C.cardDark, 0.72) : this.withAlpha(C.cardLight, 0.78), this.dp(14))); box.setBackground(this.ui.createStrokeDrawable(T.card, this.withAlpha(T.stroke, isDark ? 0.30 : 0.46), this.dp(1), this.dp(18)));
var tv = new android.widget.TextView(context); var tv = new android.widget.TextView(context);
tv.setText(String(title || "")); tv.setText(String(title || ""));
tv.setTextColor(isDark ? C.textPriDark : C.textPriLight); tv.setTextColor(T.text);
tv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 14); tv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 14);
tv.setTypeface(null, android.graphics.Typeface.BOLD); tv.setTypeface(null, android.graphics.Typeface.BOLD);
box.addView(tv); box.addView(tv);
if (desc) { if (desc) {
var dv = new android.widget.TextView(context); var dv = new android.widget.TextView(context);
dv.setText(String(desc)); dv.setText(String(desc));
dv.setTextColor(isDark ? C.textSecDark : C.textSecLight); dv.setTextColor(T.sub);
dv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 11); dv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 11);
dv.setPadding(0, this.dp(3), 0, 0); dv.setPadding(0, this.dp(3), 0, 0);
box.addView(dv); box.addView(dv);
@@ -729,11 +737,13 @@ FloatBallAppWM.prototype.createButtonEditorCollapsibleSection = function(parent,
var self = this; var self = this;
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var T = this.getAnimalIslandTheme();
var expanded = defaultExpanded !== false; var expanded = defaultExpanded !== false;
var card = new android.widget.LinearLayout(context); var card = new android.widget.LinearLayout(context);
card.setOrientation(android.widget.LinearLayout.VERTICAL); card.setOrientation(android.widget.LinearLayout.VERTICAL);
card.setPadding(this.dp(12), this.dp(10), this.dp(12), this.dp(10)); card.setPadding(this.dp(12), this.dp(10), this.dp(12), this.dp(10));
card.setBackground(this.ui.createRoundDrawable(isDark ? this.withAlpha(C.cardDark, 0.72) : this.withAlpha(C.cardLight, 0.78), this.dp(14))); card.setBackground(this.ui.createStrokeDrawable(T.card, this.withAlpha(T.stroke, isDark ? 0.30 : 0.46), this.dp(1), this.dp(18)));
try { card.setElevation(this.dp(2)); } catch(eCardElev) {}
var header = new android.widget.LinearLayout(context); var header = new android.widget.LinearLayout(context);
header.setOrientation(android.widget.LinearLayout.HORIZONTAL); header.setOrientation(android.widget.LinearLayout.HORIZONTAL);
@@ -742,14 +752,14 @@ FloatBallAppWM.prototype.createButtonEditorCollapsibleSection = function(parent,
titleBox.setOrientation(android.widget.LinearLayout.VERTICAL); titleBox.setOrientation(android.widget.LinearLayout.VERTICAL);
var tv = new android.widget.TextView(context); var tv = new android.widget.TextView(context);
tv.setText(String(title || "")); tv.setText(String(title || ""));
tv.setTextColor(isDark ? C.textPriDark : C.textPriLight); tv.setTextColor(T.text);
tv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 14); tv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 14);
tv.setTypeface(null, android.graphics.Typeface.BOLD); tv.setTypeface(null, android.graphics.Typeface.BOLD);
titleBox.addView(tv); titleBox.addView(tv);
if (desc) { if (desc) {
var dv = new android.widget.TextView(context); var dv = new android.widget.TextView(context);
dv.setText(String(desc)); dv.setText(String(desc));
dv.setTextColor(isDark ? C.textSecDark : C.textSecLight); dv.setTextColor(T.sub);
dv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 11); dv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 11);
dv.setPadding(0, this.dp(3), this.dp(8), 0); dv.setPadding(0, this.dp(3), this.dp(8), 0);
titleBox.addView(dv); titleBox.addView(dv);
@@ -759,7 +769,7 @@ FloatBallAppWM.prototype.createButtonEditorCollapsibleSection = function(parent,
header.addView(titleBox, titleLp); header.addView(titleBox, titleLp);
var toggleTv = new android.widget.TextView(context); var toggleTv = new android.widget.TextView(context);
toggleTv.setText(expanded ? "折叠 ▲" : "展开 ▼"); toggleTv.setText(expanded ? "折叠 ▲" : "展开 ▼");
toggleTv.setTextColor(C.primary); toggleTv.setTextColor(T.primaryDeep);
toggleTv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12); toggleTv.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 12);
toggleTv.setTypeface(null, android.graphics.Typeface.BOLD); toggleTv.setTypeface(null, android.graphics.Typeface.BOLD);
header.addView(toggleTv); header.addView(toggleTv);
@@ -805,16 +815,18 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
var isEditing = (this.state.editingButtonIndex !== null); var isEditing = (this.state.editingButtonIndex !== null);
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var T = this.getAnimalIslandTheme();
// 颜色配置 // 颜色配置
var bgColor = isDark ? C.bgDark : C.bgLight; var bgColor = T.bg;
var cardColor = isDark ? C.cardDark : C.cardLight; var cardColor = T.card;
var textColor = isDark ? C.textPriDark : C.textPriLight; var textColor = T.text;
var subTextColor = isDark ? C.textSecDark : C.textSecLight; var subTextColor = T.sub;
var dividerColor = isDark ? C.dividerDark : C.dividerLight; var dividerColor = T.stroke;
var inputBgColor = isDark ? C.inputBgDark : C.inputBgLight; var inputBgColor = T.card2;
var panel = this.ui.createStyledPanel(this, 16); var panel = this.ui.createStyledPanel(this, 16);
try { panel.setBackground(this.ui.createRoundDrawable(bgColor, this.dp(18))); } catch(ePanelBg) {}
// --- 标题栏 --- // --- 标题栏 ---
var header = this.ui.createStyledHeader(this, 12); var header = this.ui.createStyledHeader(this, 12);
@@ -855,7 +867,7 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
header.addView(self.ui.createSpacer(self)); header.addView(self.ui.createSpacer(self));
// 新增按钮 (右侧) // 新增按钮 (右侧)
var btnAdd = self.ui.createSolidButton(self, "新增", C.primary, android.graphics.Color.WHITE, function() { var btnAdd = self.ui.createSolidButton(self, "新增", T.primary, T.onPrimary, function() {
self.state.editingButtonIndex = -1; self.state.editingButtonIndex = -1;
if (self.state.toolAppActive && self.pushToolAppPage) self.pushToolAppPage("btn_editor"); if (self.state.toolAppActive && self.pushToolAppPage) self.pushToolAppPage("btn_editor");
else refreshPanel(); else refreshPanel();
@@ -882,7 +894,7 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
var searchSurface = new android.widget.LinearLayout(context); var searchSurface = new android.widget.LinearLayout(context);
searchSurface.setOrientation(android.widget.LinearLayout.VERTICAL); searchSurface.setOrientation(android.widget.LinearLayout.VERTICAL);
searchSurface.setPadding(self.dp(12), self.dp(10), self.dp(12), self.dp(10)); searchSurface.setPadding(self.dp(12), self.dp(10), self.dp(12), self.dp(10));
searchSurface.setBackground(self.ui.createRoundDrawable(isDark ? self.withAlpha(C.cardDark, 0.58) : self.withAlpha(C.cardLight, 0.62), self.dp(16))); searchSurface.setBackground(self.ui.createStrokeDrawable(T.card, self.withAlpha(T.stroke, isDark ? 0.30 : 0.46), self.dp(1), self.dp(18)));
var searchRow = new android.widget.LinearLayout(context); var searchRow = new android.widget.LinearLayout(context);
searchRow.setOrientation(android.widget.LinearLayout.HORIZONTAL); searchRow.setOrientation(android.widget.LinearLayout.HORIZONTAL);
searchRow.setGravity(android.view.Gravity.CENTER_VERTICAL); searchRow.setGravity(android.view.Gravity.CENTER_VERTICAL);
@@ -890,7 +902,7 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
var searchInputLp = new android.widget.LinearLayout.LayoutParams(0, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT); var searchInputLp = new android.widget.LinearLayout.LayoutParams(0, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT);
searchInputLp.weight = 1; searchInputLp.weight = 1;
searchRow.addView(searchInput.view, searchInputLp); searchRow.addView(searchInput.view, searchInputLp);
var btnSearch = self.createButtonManagerActionChip("搜索", C.primary, self.withAlpha(C.primary, 0.32), function() { var btnSearch = self.createButtonManagerActionChip("搜索", T.primaryDeep, self.withAlpha(T.primaryDeep, 0.32), function() {
try { self.state.buttonManagerQuery = String(searchInput.getValue ? searchInput.getValue() : ""); } catch(eQ) { self.state.buttonManagerQuery = ""; } try { self.state.buttonManagerQuery = String(searchInput.getValue ? searchInput.getValue() : ""); } catch(eQ) { self.state.buttonManagerQuery = ""; }
self.state.btnEditorListScrollY = 0; self.state.btnEditorListScrollY = 0;
refreshPanel(); refreshPanel();
@@ -937,8 +949,8 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
card.setOrientation(android.widget.LinearLayout.VERTICAL); card.setOrientation(android.widget.LinearLayout.VERTICAL);
card.setGravity(android.view.Gravity.CENTER_VERTICAL); card.setGravity(android.view.Gravity.CENTER_VERTICAL);
// 使用稍微不同的背景色以突出卡片 // 使用稍微不同的背景色以突出卡片
var cardBgColor = isDark ? self.withAlpha(C.cardDark, 0.8) : self.withAlpha(C.cardLight, 0.8); var cardBgColor = cardColor;
card.setBackground(self.ui.createRoundDrawable(cardBgColor, self.dp(16))); card.setBackground(self.ui.createStrokeDrawable(cardBgColor, self.withAlpha(T.stroke, isDark ? 0.28 : 0.45), self.dp(1), self.dp(18)));
try { card.setElevation(self.dp(4)); } catch(e) { safeLog(null, 'e', "catch " + String(e)); } try { card.setElevation(self.dp(4)); } catch(e) { safeLog(null, 'e', "catch " + String(e)); }
var cardLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT); var cardLp = new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT);

View File

@@ -834,23 +834,24 @@ FloatBallAppWM.prototype.buildToolAppShell = function(contentView, title, canBac
var self = this; var self = this;
var isDark = this.isDarkTheme(); var isDark = this.isDarkTheme();
var C = this.ui.colors; var C = this.ui.colors;
var T = this.getAnimalIslandTheme();
var root = new android.widget.FrameLayout(context); var root = new android.widget.FrameLayout(context);
var body = new android.widget.LinearLayout(context); var body = new android.widget.LinearLayout(context);
body.setOrientation(android.widget.LinearLayout.VERTICAL); body.setOrientation(android.widget.LinearLayout.VERTICAL);
var shellBg = isDark ? C.bgDark : C.bgLight; body.setPadding(this.dp(2), this.dp(2), this.dp(2), this.dp(2));
var shellStroke = isDark ? C.dividerDark : C.dividerLight; body.setBackground(this.ui.createStrokeDrawable(T.bg, this.withAlpha(T.stroke, isDark ? 0.42 : 0.70), this.dp(1), this.dp(24)));
body.setBackground(this.ui.createStrokeDrawable(shellBg, this.withAlpha(shellStroke, 0.18), this.dp(1), this.dp(22)));
try { body.setClipToOutline(true); } catch(eClip) {} try { body.setClipToOutline(true); } catch(eClip) {}
try { body.setElevation(this.dp(14)); } catch(eElev) { safeLog(null, 'e', "catch " + String(eElev)); } try { body.setElevation(this.dp(16)); } catch(eElev) { safeLog(null, 'e', "catch " + String(eElev)); }
root.addView(body, new android.widget.FrameLayout.LayoutParams(-1, -1)); root.addView(body, new android.widget.FrameLayout.LayoutParams(-1, -1));
var bar = new android.widget.LinearLayout(context); var bar = new android.widget.LinearLayout(context);
bar.setOrientation(android.widget.LinearLayout.HORIZONTAL); bar.setOrientation(android.widget.LinearLayout.HORIZONTAL);
bar.setGravity(android.view.Gravity.CENTER_VERTICAL); bar.setGravity(android.view.Gravity.CENTER_VERTICAL);
bar.setPadding(this.dp(10), this.dp(10), this.dp(10), this.dp(6)); bar.setPadding(this.dp(10), this.dp(10), this.dp(10), this.dp(6));
bar.setBackground(this.ui.createRoundDrawable(isDark ? this.withAlpha(C.cardDark, 0.45) : this.withAlpha(C.cardLight, 0.55), this.dp(18))); bar.setBackground(this.ui.createStrokeDrawable(T.card, this.withAlpha(T.stroke, isDark ? 0.30 : 0.45), this.dp(1), this.dp(20)));
try { bar.setElevation(this.dp(3)); } catch(eBarElev) {}
var btnBack = this.ui.createFlatButton(this, canBack ? "" : "", C.primary, function() { var btnBack = this.ui.createFlatButton(this, canBack ? "" : "", T.brown, function() {
self.popToolAppPage("topbar"); self.popToolAppPage("topbar");
}); });
btnBack.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 24); btnBack.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 24);
@@ -859,15 +860,15 @@ FloatBallAppWM.prototype.buildToolAppShell = function(contentView, title, canBac
var tvTitle = new android.widget.TextView(context); var tvTitle = new android.widget.TextView(context);
tvTitle.setText(String(title || "ToolHub")); tvTitle.setText(String(title || "ToolHub"));
tvTitle.setTextColor(isDark ? C.textPriDark : C.textPriLight); tvTitle.setTextColor(T.text);
tvTitle.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 16); tvTitle.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 17);
tvTitle.setTypeface(null, android.graphics.Typeface.BOLD); tvTitle.setTypeface(null, android.graphics.Typeface.BOLD);
tvTitle.setGravity(android.view.Gravity.CENTER_VERTICAL); tvTitle.setGravity(android.view.Gravity.CENTER_VERTICAL);
var titleLp = new android.widget.LinearLayout.LayoutParams(0, -1); var titleLp = new android.widget.LinearLayout.LayoutParams(0, -1);
titleLp.weight = 1; titleLp.weight = 1;
bar.addView(tvTitle, titleLp); bar.addView(tvTitle, titleLp);
var btnClose = this.ui.createFlatButton(this, "✕", isDark ? C.textSecDark : C.textSecLight, function() { var btnClose = this.ui.createFlatButton(this, "✕", T.sub, function() {
self.closeToolApp(); self.closeToolApp();
}); });
btnClose.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 18); btnClose.setTextSize(android.util.TypedValue.COMPLEX_UNIT_SP, 18);

View File

@@ -14,8 +14,8 @@
"size": 5598 "size": 5598
}, },
"th_04_theme.js": { "th_04_theme.js": {
"sha256": "b815acfee30e56458e61c033ab3fddfe5d8d0c52ec172c419bad7187fcb341ba", "sha256": "8e82b6095f55bbf406f82f7a9c01a77919354a67e38dd6f666676b680a2410a0",
"size": 36083 "size": 38293
}, },
"th_05_persistence.js": { "th_05_persistence.js": {
"sha256": "d80787c2810839ebbe499e93db3df33d6e8d2d6b6ae71644ce351db0f36e4d3e", "sha256": "d80787c2810839ebbe499e93db3df33d6e8d2d6b6ae71644ce351db0f36e4d3e",
@@ -54,12 +54,12 @@
"size": 20386 "size": 20386
}, },
"th_14_panels.js": { "th_14_panels.js": {
"sha256": "47f49f5def41514c6a9a082fd06fcd0cc572a1650021309dbc946854e261ee0b", "sha256": "d89af917e8a594c5da78fa1e77203da8eddd3f49648e18de320d40b1a5e4a522",
"size": 244271 "size": 244218
}, },
"th_15_extra.js": { "th_15_extra.js": {
"sha256": "203e65c53d1cd37135af22584b90a89d43ec5f2a7ce1aada18a5d90a49b417d9", "sha256": "a95432faf7a8622b74107ea175154c903061dea362981a96554bb7bf78f8a428",
"size": 90774 "size": 90762
}, },
"th_16_entry.js": { "th_16_entry.js": {
"sha256": "e7c99c3dfbd6aedab05551426955081ae6cae034754f2f557cefa01dc75dc001", "sha256": "e7c99c3dfbd6aedab05551426955081ae6cae034754f2f557cefa01dc75dc001",
@@ -68,5 +68,5 @@
}, },
"keyId": "toolhub-targets-2026-rsa3072", "keyId": "toolhub-targets-2026-rsa3072",
"schema": 2, "schema": 2,
"version": 20260514104438 "version": 20260514142843
} }

View File

@@ -1 +1 @@
lcUYKpPt8XY3inn6Lt0GjCE4zBryJiafB2j7gBT6DkH12WR4nF4u3zSlAEEKu+aKAfMUYfupb1qOltGliIy/RtVAPWcVClLuQEsCVsZ0lP9IUiXIrsoKCQLRnD6K+0lPqY1NDtZK/rouA3q+j9AIqcvA6KUH3dG44LufV59xAPo5/XGF96sUcLGdGueZbNOgxR0RhJll2cUtSAP78YQob8iZxzoF1HlhI0Wzhlgqpo2qQdHJzDGigalgYWYjjkxahhZGjQlw9xBrf5KMJK+h0nD8BeKWyOO+Ieh8fFSuTY6r7qu9tj5cTLVorgP86YjSHinInU5n/XUe9oHGOg8waN81M5XWurLfIsxL7Sth2skix+n3s6KcEDp5hhjzydmhayHt9v2scQUlnIZdA2S0yw5ewwVIzBT5ohPEeKmSYzGJJLJPTdXkLxUbsL/P+hFO7dxqm2qT/uGF6PRup60uGAG94MfJ6iIQeLjLbzy9nUel/K8e/x1jDXn0WWAIFY/u j0oTSR5ZVRDOvqR9jOi5IcvH7KDrHCDMRhZCDAivu7fCuudETXv/mwgActNQB8ouzPEeZ74JwVqWYdmaLrDI2tygFHBJX3arxilpzLiXl+d/abJR/Y5/h3eU715JHcoeuQ58ZdH6fm2yHyeUsKqwcYGyuoiQs5kC11xcZSOK5y7O3X/TFRaTjC4WNcZYdHAwVW9Flfw9+40k+LE6HeBBOKUqG00NE1rnjmPGAsZzU9/Gp6UjuNlyOYLQ+Ds7HnLX+SeK2IcK5uOqQqgZuz8YsgayTZ3xp4RQws7tteptZUv+2cUfsFpqfrMp/zqon0SW/oiF/VspV/yS1PfrcgKXqhxNhS/CyPZESmhB4nkinsGeAfz+nvpi9mWmtc2g8ij8S5oPKuSZ1VsD9XVH0J3z6GI9XGmheTgTKxmd45+FICaGRngxk+WR7l1akfPo3olmqaycFTExyswUZpx2Cct6Dj6Na5I92tbJ57rwT8E8P5IOhdHINLDXtBrV5NSFRil7