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
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ollama 模型对话"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="系统提示:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etSystemPrompt"
|
||||
@@ -57,7 +57,7 @@
|
||||
android:layout_height="100dp"
|
||||
android:background="#2D2D2D"
|
||||
android:hint="请输入系统提示"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:gravity="top|start"
|
||||
android:inputType="textMultiLine" />
|
||||
@@ -67,7 +67,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="模型名称:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etModelName"
|
||||
@@ -76,7 +76,7 @@
|
||||
android:background="#2D2D2D"
|
||||
android:hint="llama3"
|
||||
android:text="llama3"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:singleLine="true" />
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="系统消息:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etUserMessage"
|
||||
@@ -120,7 +120,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:text="发送"
|
||||
android:textColor="#FFFFFF" />
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnStop"
|
||||
@@ -129,7 +129,7 @@
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="停止"
|
||||
android:textColor="#FF5252" />
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -20,14 +20,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="10.8.0.250:456"
|
||||
android:id="@+id/rb_debughost"
|
||||
android:onClick="onSwitchHost"/>
|
||||
android:onClick="onSwitchHost"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="yun.winboll.cc"
|
||||
android:id="@+id/rb_yunhost"
|
||||
android:onClick="onSwitchHost"/>
|
||||
android:onClick="onSwitchHost"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ollama 模型对话"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="系统提示:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etSystemPrompt"
|
||||
@@ -47,7 +47,7 @@
|
||||
android:layout_height="100dp"
|
||||
android:background="#2D2D2D"
|
||||
android:hint="请输入系统提示"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:gravity="top|start"
|
||||
android:inputType="textMultiLine" />
|
||||
@@ -59,7 +59,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="模型名称:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etModelName"
|
||||
@@ -68,7 +68,7 @@
|
||||
android:background="#2D2D2D"
|
||||
android:hint="llama3"
|
||||
android:text="llama3"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:singleLine="true" />
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="温度设置:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -92,7 +92,7 @@
|
||||
android:layout_weight="1"
|
||||
android:background="#2D2D2D"
|
||||
android:hint="0.7"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:digits="0123456789.,-"
|
||||
android:singleLine="true" />
|
||||
@@ -104,7 +104,7 @@
|
||||
android:layout_weight="1"
|
||||
android:background="#2D2D2D"
|
||||
android:hint="4096"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:digits="0123456789."
|
||||
android:singleLine="true" />
|
||||
@@ -116,7 +116,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="系统消息:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -128,7 +128,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="用户消息:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etUserMessage"
|
||||
@@ -147,7 +147,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="响应消息:"
|
||||
android:textColor="#B0B0B0" />
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -170,7 +170,7 @@
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="清空"
|
||||
android:textColor="#FFFFFF" />
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
android:text="Debug Mode"
|
||||
android:layout_weight="1.0"
|
||||
android:onClick="onSwitchDebugMode"
|
||||
android:id="@+id/activitymainCheckBox1"/>
|
||||
android:id="@+id/activitymainCheckBox1"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="支付状态:未支付"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"/>
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_create_order"
|
||||
|
||||
@@ -20,14 +20,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="10.8.0.250:456"
|
||||
android:id="@+id/rb_debughost"
|
||||
android:onClick="onSwitchHost"/>
|
||||
android:onClick="onSwitchHost"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="yun.winboll.cc"
|
||||
android:id="@+id/rb_yunhost"
|
||||
android:onClick="onSwitchHost"/>
|
||||
android:onClick="onSwitchHost"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ollama 配置"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -31,7 +31,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="API 地址"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="http://localhost:11434"
|
||||
android:text="http://localhost:11434"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="textUri"
|
||||
android:singleLine="true"
|
||||
@@ -54,7 +54,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模型名称"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="模型名称 (如:llama3)"
|
||||
android:text="llama3"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="textCapCharacters"
|
||||
android:singleLine="true"
|
||||
@@ -77,7 +77,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="温度设置"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="0.7"
|
||||
android:text="0.7"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
@@ -101,7 +101,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="最大 token 数"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="4096"
|
||||
android:text="4096"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
@@ -124,7 +124,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="系统提示"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="你是 WinBoLL Ollama API 客户端..."
|
||||
android:text="你是 WinBoLL Ollama API 客户端。用户将向你提问,请给予有用的、详细的回答。"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="textMultiLine"
|
||||
android:gravity="top|start"
|
||||
@@ -148,7 +148,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="API 版本"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="v1"
|
||||
android:text="v1"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="textCapCharacters"
|
||||
android:singleLine="true"
|
||||
@@ -171,7 +171,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="调试模式"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="false"
|
||||
android:text="false"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textColorHint="#666666"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
@@ -207,7 +207,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="保存配置"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
@@ -219,7 +219,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="加载配置"
|
||||
android:textColor="#4A90E2"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
@@ -231,7 +231,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="重置"
|
||||
android:textColor="#B0B0B0"
|
||||
|
||||
android:textSize="14sp"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
@@ -249,7 +249,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="#00CC00"
|
||||
|
||||
android:textSize="12sp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="8dp" />
|
||||
@@ -258,7 +258,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="保存后,配置将对所有会话生效"
|
||||
android:textColor="#666666"
|
||||
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Position Service"
|
||||
android:padding="10dp"
|
||||
android:id="@+id/fragmentmainSwitch1"/>
|
||||
android:id="@+id/fragmentmainSwitch1"
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff"
|
||||
|
||||
android:textSize="18sp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/toolbar_icon"
|
||||
|
||||
Reference in New Issue
Block a user