summaryrefslogtreecommitdiff
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
author Wesley Wang <wesleycwwang@google.com> 2023-03-10 19:43:03 +0800
committer YK Hung <ykhung@google.com> 2023-03-13 10:23:38 +0000
commit7a8592e923714632a805412080f0af207aa662e3 (patch)
tree44d8e1a4cf06ef63ee8c1f17be626e981ecf91cb /packages/SettingsLib/src
parent1ce0d2cf5bcf8998a37a92de9920bec77ca1b5b8 (diff)
Update status bar battery icon
- Update low battery threshold to 20 since low battery warning already set as 20 - Update battery saver render format and color screenshots: https://screenshot.googleplex.com/6MUsuq7McxAEpZg.png https://screenshot.googleplex.com/38RfSn8LwiZcJD5.png https://screenshot.googleplex.com/3bUVN4TCaeDdrDy.png https://screenshot.googleplex.com/3hJ9aNJwbLUiGSP.png https://screenshot.googleplex.com/S6xakjvHQu2aNMS.png Bug: 265364329 Fix: 265364329 Test: make RunSettingsLibRoboTests Change-Id: I72bd3f52db141835123dca83662354d462fb74a2
Diffstat (limited to 'packages/SettingsLib/src')
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt b/packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt
index faea5b2c3e71..a03acc3a078c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt
@@ -135,7 +135,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int)
}
private val errorPaint = Paint(Paint.ANTI_ALIAS_FLAG).also { p ->
- p.color = Utils.getColorStateListDefaultColor(context, R.color.batterymeter_plus_color)
+ p.color = Utils.getColorStateListDefaultColor(context, R.color.batterymeter_saver_color)
p.alpha = 255
p.isDither = true
p.strokeWidth = 0f
@@ -244,10 +244,11 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int)
c.drawPath(scaledBolt, fillColorStrokeProtection)
}
} else if (powerSaveEnabled) {
- // If power save is enabled draw the perimeter path with colorError
- c.drawPath(scaledErrorPerimeter, errorPaint)
+ // If power save is enabled draw the level path with colorError
+ c.drawPath(levelPath, errorPaint)
// And draw the plus sign on top of the fill
- c.drawPath(scaledPlus, errorPaint)
+ fillPaint.color = fillColor
+ c.drawPath(scaledPlus, fillPaint)
}
c.restore()
}
@@ -414,7 +415,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int)
companion object {
const val WIDTH = 12f
const val HEIGHT = 20f
- private const val CRITICAL_LEVEL = 15
+ private const val CRITICAL_LEVEL = 20
// On a 12x20 grid, how wide to make the fill protection stroke.
// Scales when our size changes
private const val PROTECTION_STROKE_WIDTH = 3f