fix: lighten animal island main panel

This commit is contained in:
7015725
2026-05-19 03:37:25 +08:00
parent 4ce1924299
commit d557bdefa2
4 changed files with 21 additions and 55 deletions

View File

@@ -859,10 +859,10 @@ FloatBallAppWM.prototype.updatePanelBackground = function(panelView) {
var radiusDp = 22;
if (settTheme === "animal" && this.getAnimalIslandTheme) {
var T = this.getAnimalIslandTheme();
bgInt = this.withAlpha(isDark ? T.bg : T.bg2, isDark ? 0.96 : 0.94);
tc = T.text;
stroke = this.withAlpha(T.stroke, isDark ? 0.28 : 0.34);
var Color = android.graphics.Color;
bgInt = Color.parseColor(isDark ? "#27362E" : "#E4F1DF");
tc = Color.parseColor(isDark ? "#F5EBD2" : "#3F3528");
stroke = this.withAlpha(Color.parseColor(isDark ? "#526454" : "#E8DEC8"), isDark ? 0.50 : 0.52);
radiusDp = 30;
} else {
bgInt = this.getPanelBgColorInt();

View File

@@ -95,25 +95,22 @@ FloatBallAppWM.prototype.buildPanelView = function(panelType) {
var panelStrokeColor = isDark ? C.dividerDark : C.dividerLight;
var cardStrokeColor = isDark ? C.dividerDark : C.dividerLight;
var pressedCardColor = this.withAlpha(C.primary, 0.20);
var iconBubbleColor = pressedCardColor;
var iconTintColor = textColor;
var panelRadiusDp = 22;
var cardRadiusDp = 12;
var panelElevationDp = 8;
var cardElevationDp = 2;
if (useAnimalPanel && TPanel) {
bgColor = this.withAlpha(isDark ? TPanel.bg : TPanel.bg2, isDark ? 0.96 : 0.94);
cardColor = TPanel.card;
textColor = TPanel.text;
panelStrokeColor = this.withAlpha(TPanel.stroke, isDark ? 0.28 : 0.34);
cardStrokeColor = this.withAlpha(TPanel.stroke, isDark ? 0.26 : 0.34);
pressedCardColor = isDark ? this.withAlpha(TPanel.primarySoft, 0.92) : this.withAlpha(TPanel.primarySoft, 0.98);
iconBubbleColor = isDark ? this.withAlpha(TPanel.card2, 0.92) : TPanel.primarySoft;
iconTintColor = TPanel.sub;
var Color = android.graphics.Color;
bgColor = Color.parseColor(isDark ? "#27362E" : "#E4F1DF");
cardColor = Color.parseColor(isDark ? "#34463A" : "#FFFDF4");
textColor = Color.parseColor(isDark ? "#F5EBD2" : "#3F3528");
panelStrokeColor = this.withAlpha(Color.parseColor(isDark ? "#526454" : "#E8DEC8"), isDark ? 0.50 : 0.52);
cardStrokeColor = this.withAlpha(Color.parseColor(isDark ? "#526454" : "#E8DEC8"), isDark ? 0.52 : 0.56);
pressedCardColor = this.withAlpha(Color.parseColor(isDark ? "#526454" : "#DDEEDB"), isDark ? 0.36 : 0.42);
panelRadiusDp = 30;
cardRadiusDp = 22;
panelElevationDp = isDark ? 2 : 3;
cardRadiusDp = 20;
panelElevationDp = isDark ? 1 : 2;
cardElevationDp = isDark ? 1 : 2;
}
@@ -197,16 +194,6 @@ FloatBallAppWM.prototype.buildPanelView = function(panelType) {
return sd;
}
function isAppLikeIcon(btnObj) {
try {
if (!btnObj) return false;
var tp = (btnObj.type == null) ? "" : String(btnObj.type);
var pkg = (btnObj.pkg == null) ? "" : String(btnObj.pkg);
if ((tp === "app" || tp === "shortcut") && pkg.length > 0) return true;
} catch(eAppLike) {}
return false;
}
scroll.setOnTouchListener(new JavaAdapter(android.view.View.OnTouchListener, {
onTouch: function(v, e) { self.touchActivity(); return false; }
}));
@@ -251,12 +238,7 @@ FloatBallAppWM.prototype.buildPanelView = function(panelType) {
var dr = this.resolveIconDrawable(btnCfg);
if (dr) {
iv.setImageDrawable(dr);
// 如果图标是白色的(通常是系统图标),且我们在亮色卡片上,可能需要染色
// 但 resolveIconDrawable 逻辑比较复杂,这里暂时不强制染色,除非用户配置了 TINT
if (btnCfg && !isAppLikeIcon(btnCfg) && !btnCfg.iconPath) {
// ShortX/系统图标与问号占位走主题色,避免灰黑重阴影感
try { iv.setColorFilter(useAnimalPanel ? iconTintColor : (isDark ? C.textPriDark : C.textPriLight), android.graphics.PorterDuff.Mode.SRC_IN); } catch(eCF) { safeLog(null, 'e', "catch " + String(eCF)); }
}
// 主面板是高频工具入口:默认保留图标原色;仅 resolveIconDrawable 内显式 iconTint 时才染色
}
var ivLp = new android.widget.LinearLayout.LayoutParams(
@@ -264,23 +246,7 @@ FloatBallAppWM.prototype.buildPanelView = function(panelType) {
this.dp(this.config.PANEL_ICON_SIZE_DP)
);
iv.setLayoutParams(ivLp);
if (btnCfg && useAnimalPanel && !isAppLikeIcon(btnCfg)) {
var iconBubble = new android.widget.FrameLayout(context);
iconBubble.setForegroundGravity(android.view.Gravity.CENTER);
iconBubble.setBackground(self.ui.createStrokeDrawable(iconBubbleColor, self.withAlpha(TPanel.stroke, isDark ? 0.20 : 0.24), self.dp(1), self.dp(15)));
iconBubble.setPadding(self.dp(4), self.dp(4), self.dp(4), self.dp(4));
var bubbleLp = new android.widget.LinearLayout.LayoutParams(self.dp(38), self.dp(38));
iconBubble.setLayoutParams(bubbleLp);
var ivInBubbleLp = new android.widget.FrameLayout.LayoutParams(
self.dp(self.config.PANEL_ICON_SIZE_DP),
self.dp(self.config.PANEL_ICON_SIZE_DP),
android.view.Gravity.CENTER
);
iconBubble.addView(iv, ivInBubbleLp);
cell.addView(iconBubble);
} else {
cell.addView(iv);
}
cell.addView(iv);
if (this.config.PANEL_LABEL_ENABLED) {
var tv = new android.widget.TextView(context);