fix: 电池内部数字改为黑色,避免和填充条颜色混淆

白字压绿底几乎看不见,改为黑色在任何填充色上都清晰

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-05-07 15:21:23 +09:30
parent 78d1977b98
commit 10dacd26ef

View File

@@ -116,10 +116,11 @@ class StatusBarView @JvmOverloads constructor(
canvas.drawRoundRect(fillRect, 2f, 2f, paint) canvas.drawRoundRect(fillRect, 2f, 2f, paint)
// 电池内部文字:充电时显示 ⚡,否则显示百分比 // 电池内部文字:充电时显示 ⚡,否则显示百分比
// 深色文字确保在任何填充色上都清晰可读
if (batteryLevel >= 0) { if (batteryLevel >= 0) {
val text = if (isCharging) "" else "${batteryLevel}" val text = if (isCharging) "" else "${batteryLevel}"
paint.style = Paint.Style.FILL paint.style = Paint.Style.FILL
paint.color = 0xFFFFFFFF.toInt() paint.color = 0xFF000000.toInt()
paint.textSize = 11f paint.textSize = 11f
paint.textAlign = Paint.Align.CENTER paint.textAlign = Paint.Align.CENTER
paint.typeface = android.graphics.Typeface.DEFAULT_BOLD paint.typeface = android.graphics.Typeface.DEFAULT_BOLD