Loading packages/SettingsLib/res/values/arrays.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -572,7 +572,7 @@ <!-- BatteryMeterView parameters --> <!-- BatteryMeterView parameters --> <array name="batterymeter_color_levels"> <array name="batterymeter_color_levels"> <item>15</item> <item>20</item> <item>100</item> <item>100</item> </array> </array> <array name="batterymeter_color_values"> <array name="batterymeter_color_values"> Loading packages/SettingsLib/res/values/colors.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -43,4 +43,6 @@ <color name="qr_focused_corner_line_color">#ff1a73e8</color> <color name="qr_focused_corner_line_color">#ff1a73e8</color> <color name="qr_background_color">#b3ffffff</color> <!-- 70% white transparency --> <color name="qr_background_color">#b3ffffff</color> <!-- 70% white transparency --> <!-- End of QR code scanner colors --> <!-- End of QR code scanner colors --> <color name="batterymeter_saver_color">#FBBC04</color> </resources> </resources> packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt +6 −5 Original line number Original line Diff line number Diff line Loading @@ -135,7 +135,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int) } } private val errorPaint = Paint(Paint.ANTI_ALIAS_FLAG).also { p -> 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.alpha = 255 p.isDither = true p.isDither = true p.strokeWidth = 0f p.strokeWidth = 0f Loading Loading @@ -244,10 +244,11 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int) c.drawPath(scaledBolt, fillColorStrokeProtection) c.drawPath(scaledBolt, fillColorStrokeProtection) } } } else if (powerSaveEnabled) { } else if (powerSaveEnabled) { // If power save is enabled draw the perimeter path with colorError // If power save is enabled draw the level path with colorError c.drawPath(scaledErrorPerimeter, errorPaint) c.drawPath(levelPath, errorPaint) // And draw the plus sign on top of the fill // And draw the plus sign on top of the fill c.drawPath(scaledPlus, errorPaint) fillPaint.color = fillColor c.drawPath(scaledPlus, fillPaint) } } c.restore() c.restore() } } Loading Loading @@ -414,7 +415,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int) companion object { companion object { const val WIDTH = 12f const val WIDTH = 12f const val HEIGHT = 20f 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. // On a 12x20 grid, how wide to make the fill protection stroke. // Scales when our size changes // Scales when our size changes private const val PROTECTION_STROKE_WIDTH = 3f private const val PROTECTION_STROKE_WIDTH = 3f Loading Loading
packages/SettingsLib/res/values/arrays.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -572,7 +572,7 @@ <!-- BatteryMeterView parameters --> <!-- BatteryMeterView parameters --> <array name="batterymeter_color_levels"> <array name="batterymeter_color_levels"> <item>15</item> <item>20</item> <item>100</item> <item>100</item> </array> </array> <array name="batterymeter_color_values"> <array name="batterymeter_color_values"> Loading
packages/SettingsLib/res/values/colors.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -43,4 +43,6 @@ <color name="qr_focused_corner_line_color">#ff1a73e8</color> <color name="qr_focused_corner_line_color">#ff1a73e8</color> <color name="qr_background_color">#b3ffffff</color> <!-- 70% white transparency --> <color name="qr_background_color">#b3ffffff</color> <!-- 70% white transparency --> <!-- End of QR code scanner colors --> <!-- End of QR code scanner colors --> <color name="batterymeter_saver_color">#FBBC04</color> </resources> </resources>
packages/SettingsLib/src/com/android/settingslib/graph/ThemedBatteryDrawable.kt +6 −5 Original line number Original line Diff line number Diff line Loading @@ -135,7 +135,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int) } } private val errorPaint = Paint(Paint.ANTI_ALIAS_FLAG).also { p -> 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.alpha = 255 p.isDither = true p.isDither = true p.strokeWidth = 0f p.strokeWidth = 0f Loading Loading @@ -244,10 +244,11 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int) c.drawPath(scaledBolt, fillColorStrokeProtection) c.drawPath(scaledBolt, fillColorStrokeProtection) } } } else if (powerSaveEnabled) { } else if (powerSaveEnabled) { // If power save is enabled draw the perimeter path with colorError // If power save is enabled draw the level path with colorError c.drawPath(scaledErrorPerimeter, errorPaint) c.drawPath(levelPath, errorPaint) // And draw the plus sign on top of the fill // And draw the plus sign on top of the fill c.drawPath(scaledPlus, errorPaint) fillPaint.color = fillColor c.drawPath(scaledPlus, fillPaint) } } c.restore() c.restore() } } Loading Loading @@ -414,7 +415,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int) companion object { companion object { const val WIDTH = 12f const val WIDTH = 12f const val HEIGHT = 20f 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. // On a 12x20 grid, how wide to make the fill protection stroke. // Scales when our size changes // Scales when our size changes private const val PROTECTION_STROKE_WIDTH = 3f private const val PROTECTION_STROKE_WIDTH = 3f Loading