Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37f74027 authored by Evan Laird's avatar Evan Laird
Browse files

[Old [Battery] [Flexi]] Use textColorPrimary for ShadeHeader

This keeps the battery icon's color aligned with the rest of the icons
in ShadeHeader.

Test: visual
Bug: 330439834
Flag: NONE
Change-Id: I5639f63996c612e80d742bc02e894f089703f300
parent 34b8bf5d
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -372,6 +372,20 @@ private fun BatteryIcon(
            val batteryIcon = BatteryMeterView(context, null)
            batteryIcon.setPercentShowMode(BatteryMeterView.MODE_ON)

            val themedContext =
                ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings_Header)
            val fg = Utils.getColorAttrDefaultColor(themedContext, android.R.attr.textColorPrimary)
            val bg =
                Utils.getColorAttrDefaultColor(
                    themedContext,
                    android.R.attr.textColorPrimaryInverse,
                )

            // [BatteryMeterView.updateColors] is an old method that was built to distinguish
            // between dual-tone colors and single-tone. The current icon is only single-tone, so
            // the final [fg] is the only one we actually need
            batteryIcon.updateColors(fg, bg, fg)

            val batteryMaterViewController =
                createBatteryMeterViewController(batteryIcon, StatusBarLocation.QS)
            batteryMaterViewController.init()