From 54f77a8d87d498844ef810c0ff6f1191e01cd6d3 Mon Sep 17 00:00:00 2001 From: LaizyBoy Date: Sun, 10 May 2026 05:28:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(AboutView):=20=E9=80=82=E9=85=8D=E6=B7=B1?= =?UTF-8?q?=E8=89=B2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化布局颜色:应用名改为colorPrimaryDark,分割线改为gray_400 - 功能项背景根据深色/浅色模式动态设置背景色(gray_800/white) - 功能项标题文字根据深色/浅色模式动态设置颜色(gray_100/gray_900) --- .../cc/winboll/studio/libappbase/views/AboutView.java | 8 +++++--- libappbase/src/main/res/layout/layout_about_view.xml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libappbase/src/main/java/cc/winboll/studio/libappbase/views/AboutView.java b/libappbase/src/main/java/cc/winboll/studio/libappbase/views/AboutView.java index 5634df0..1eecb39 100644 --- a/libappbase/src/main/java/cc/winboll/studio/libappbase/views/AboutView.java +++ b/libappbase/src/main/java/cc/winboll/studio/libappbase/views/AboutView.java @@ -421,9 +421,10 @@ public class AboutView extends LinearLayout { */ private android.graphics.drawable.Drawable create_item_background() { android.graphics.drawable.GradientDrawable drawable = new android.graphics.drawable.GradientDrawable(); - drawable.setStroke(1, mItemContext.getResources().getColor(R.color.gray_200)); + drawable.setStroke(1, mItemContext.getResources().getColor(R.color.gray_400)); drawable.setCornerRadius(4); - drawable.setColor(mItemContext.getResources().getColor(android.R.color.white)); + boolean isNightMode = (mItemContext.getResources().getConfiguration().uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK) == android.content.res.Configuration.UI_MODE_NIGHT_YES; + drawable.setColor(isNightMode ? mItemContext.getResources().getColor(R.color.gray_800) : mItemContext.getResources().getColor(android.R.color.white)); return drawable; } @@ -449,7 +450,8 @@ public class AboutView extends LinearLayout { TextView tvTitle = new TextView(mItemContext); tvTitle.setText(mTitle); tvTitle.setTextSize(16); - tvTitle.setTextColor(mItemContext.getResources().getColor(R.color.gray_900)); + boolean isNightMode = (mItemContext.getResources().getConfiguration().uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK) == android.content.res.Configuration.UI_MODE_NIGHT_YES; + tvTitle.setTextColor(isNightMode ? mItemContext.getResources().getColor(R.color.gray_100) : mItemContext.getResources().getColor(R.color.gray_900)); llText.addView(tvTitle); // 内容 TextView tvContent = new TextView(mItemContext); diff --git a/libappbase/src/main/res/layout/layout_about_view.xml b/libappbase/src/main/res/layout/layout_about_view.xml index 38949c4..6d712e5 100644 --- a/libappbase/src/main/res/layout/layout_about_view.xml +++ b/libappbase/src/main/res/layout/layout_about_view.xml @@ -26,7 +26,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="18sp" - android:textColor="@color/gray_900"/> + android:textColor="@color/colorPrimaryDark"/> + android:background="@color/gray_400"/>