From 83a1b45cc8d1d6d4f5d8d275db29fc7ed3f34cff Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Wed, 10 Jan 2024 23:36:41 +0800 Subject: [PATCH 34/34] SystemUI: Follow monet theme on battery chip Why does this chip even exist... Change-Id: I178fdda5d8d310c4c7fa5f05f9911b3f94986cb9 --- packages/SystemUI/res/drawable/statusbar_chip_bg.xml | 8 +++----- .../com/android/systemui/statusbar/BatteryStatusChip.kt | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/res/drawable/statusbar_chip_bg.xml b/packages/SystemUI/res/drawable/statusbar_chip_bg.xml index d7de16d7c5bb..dd1db04e77d7 100644 --- a/packages/SystemUI/res/drawable/statusbar_chip_bg.xml +++ b/packages/SystemUI/res/drawable/statusbar_chip_bg.xml @@ -15,9 +15,7 @@ limitations under the License. --> - - + + - \ No newline at end of file + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt b/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt index 835225009110..04373eb7ed87 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt @@ -22,6 +22,7 @@ import android.util.AttributeSet import android.view.View import android.widget.FrameLayout import android.widget.LinearLayout +import com.android.settingslib.Utils import com.android.systemui.battery.BatteryMeterView import com.android.systemui.res.R import com.android.systemui.statusbar.events.BackgroundAnimatableView @@ -65,6 +66,11 @@ class BatteryStatusChip @JvmOverloads constructor(context: Context, attrs: Attri @SuppressLint("UseCompatLoadingForDrawables") private fun updateResources() { + val primaryColor = + Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse) + val textColorSecondary = + Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorSecondaryInverse) + batteryMeterView.updateColors(primaryColor, textColorSecondary, primaryColor) roundedContainer.background = mContext.getDrawable(R.drawable.statusbar_chip_bg) } } -- 2.34.1