From e20638c3861993e8593aa50957439b8d7d854c3b Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Mon, 9 May 2022 16:33:06 -0400 Subject: [PATCH] Use quick settings theme for the privacy chip This change creates a ContextThemeWrapper for the system animation chip so that the attr lookups grab the correct tint for the icon in the privacy animtaion chip. Test: manual; trigger privacy chip in non-dark-mode Fixes: 188281142 Change-Id: I7f565b0b63abc6602cbcc3706ab03f3388eff791 --- .../statusbar/events/SystemEventChipAnimationController.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt index 7800b4cf4aa69..8405aea218f01 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt @@ -22,6 +22,7 @@ import android.animation.AnimatorSet import android.animation.ValueAnimator import android.content.Context import android.graphics.Rect +import android.view.ContextThemeWrapper import android.view.Gravity import android.view.LayoutInflater import android.view.View @@ -46,6 +47,7 @@ class SystemEventChipAnimationController @Inject constructor( ) : SystemStatusAnimationCallback { private lateinit var animationWindowView: FrameLayout + private lateinit var themedContext: ContextThemeWrapper private var currentAnimatedView: BackgroundAnimatableView? = null @@ -76,7 +78,7 @@ class SystemEventChipAnimationController @Inject constructor( // Initialize the animated view val insets = contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation() - currentAnimatedView = viewCreator(context).also { + currentAnimatedView = viewCreator(themedContext).also { animationWindowView.addView( it.view, layoutParamsDefault( @@ -221,7 +223,8 @@ class SystemEventChipAnimationController @Inject constructor( private fun init() { initialized = true - animationWindowView = LayoutInflater.from(context) + themedContext = ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings) + animationWindowView = LayoutInflater.from(themedContext) .inflate(R.layout.system_event_animation_window, null) as FrameLayout val lp = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT) lp.gravity = Gravity.END or Gravity.CENTER_VERTICAL