Files
WinBoLL/mymessagemanager/src/main/res/values/styles.xml
LaizyBoy 55c7f7d327 feat: 统一应用文本颜色由主题控制,支持深色/普通模式自适应
主题改造(mymessagemanager):
  - values/styles.xml + values-night/styles.xml:6种风格x2模式共12个主题
    统一设置 android:textColorPrimary / textColorPrimary / android:textColor / colorTextColor
    指向 @color/text_color_primary
  - values/colors.xml:text_color_primary=#FF000000(普通模式黑色)
  - values-night/colors.xml:text_color_primary=#FF00FF00(深色模式绿色)
  - attrs.xml:声明 textColorPrimary 属性解决 AAPT2 编译错误

清除硬编码文本颜色(跨模块):
  - 移除 13 个布局文件中的 android:textColor 属性(libappbase/libaes/winboll/appbase)
  - 移除 3 个 Java 文件中的 setTextColor(Color.BLACK/white/gray) 调用
  - 移除 ComposeSMSActivity / CharsetRefuseEditDialog 中的自定义文本颜色
  - 移除 toast_custom_view.xml / view_tts_back.xml 中的 android:textColor

CompoundButton 文本颜色适配:
  - ConfirmSwitchView:initView 中读取主题 textColorPrimary 的 ColorStateList 并显式设置
  - activity_appsettings.xml:平台 Switch 替换为 ConfirmSwitchView
  - fragment_main.xml:Switch 添加 textColor=?android:attr/textColorPrimary
  - 10个 RadioButton + 4个 CheckBox 添加 textColor=?android:attr/textColorPrimary
2026-05-09 10:02:44 +08:00

78 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyAppTheme" parent="AESTheme">
<item name="android:textSize">20sp</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:textColorPrimary">@color/text_color_primary</item>
<item name="textColorPrimary">@color/text_color_primary</item>
<item name="android:textColor">@color/text_color_primary</item>
<item name="colorTextColor">@color/text_color_primary</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColor</item>
</style>
<style name="MyDepthAESTheme" parent="DepthAESTheme">
<item name="android:textSize">20sp</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:textColorPrimary">@color/text_color_primary</item>
<item name="textColorPrimary">@color/text_color_primary</item>
<item name="android:textColor">@color/text_color_primary</item>
<item name="colorTextColor">@color/text_color_primary</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorDepth</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorDepth</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorDepth</item>
</style>
<style name="MySkyAESTheme" parent="SkyAESTheme">
<item name="android:textSize">20sp</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:textColorPrimary">@color/text_color_primary</item>
<item name="textColorPrimary">@color/text_color_primary</item>
<item name="android:textColor">@color/text_color_primary</item>
<item name="colorTextColor">@color/text_color_primary</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorSky</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorSky</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorSky</item>
</style>
<style name="MyGoldenAESTheme" parent="GoldenAESTheme">
<item name="android:textSize">20sp</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:textColorPrimary">@color/text_color_primary</item>
<item name="textColorPrimary">@color/text_color_primary</item>
<item name="android:textColor">@color/text_color_primary</item>
<item name="colorTextColor">@color/text_color_primary</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorGolden</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorGolden</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorGolden</item>
</style>
<style name="MyMemorAESTheme" parent="MemorAESTheme">
<item name="android:textSize">20sp</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:textColorPrimary">@color/text_color_primary</item>
<item name="textColorPrimary">@color/text_color_primary</item>
<item name="android:textColor">@color/text_color_primary</item>
<item name="colorTextColor">@color/text_color_primary</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorMemor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorMemor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorMemor</item>
</style>
<style name="MyTaoAESTheme" parent="TaoAESTheme">
<item name="android:textSize">20sp</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:textColorPrimary">@color/text_color_primary</item>
<item name="textColorPrimary">@color/text_color_primary</item>
<item name="android:textColor">@color/text_color_primary</item>
<item name="colorTextColor">@color/text_color_primary</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorTao</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorTao</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorTao</item>
</style>
</resources>