feat(AboutView): 适配深色模式

- 优化布局颜色:应用名改为colorPrimaryDark,分割线改为gray_400
- 功能项背景根据深色/浅色模式动态设置背景色(gray_800/white)
- 功能项标题文字根据深色/浅色模式动态设置颜色(gray_100/gray_900)
This commit is contained in:
2026-05-10 05:28:06 +08:00
parent 69b18343c9
commit 54f77a8d87
2 changed files with 7 additions and 5 deletions

View File

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