Merge "Use quick settings theme for the privacy chip" into tm-dev
This commit is contained in:
@@ -22,6 +22,7 @@ import android.animation.AnimatorSet
|
|||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
|
import android.view.ContextThemeWrapper
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -46,6 +47,7 @@ class SystemEventChipAnimationController @Inject constructor(
|
|||||||
) : SystemStatusAnimationCallback {
|
) : SystemStatusAnimationCallback {
|
||||||
|
|
||||||
private lateinit var animationWindowView: FrameLayout
|
private lateinit var animationWindowView: FrameLayout
|
||||||
|
private lateinit var themedContext: ContextThemeWrapper
|
||||||
|
|
||||||
private var currentAnimatedView: BackgroundAnimatableView? = null
|
private var currentAnimatedView: BackgroundAnimatableView? = null
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@ class SystemEventChipAnimationController @Inject constructor(
|
|||||||
|
|
||||||
// Initialize the animated view
|
// Initialize the animated view
|
||||||
val insets = contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()
|
val insets = contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()
|
||||||
currentAnimatedView = viewCreator(context).also {
|
currentAnimatedView = viewCreator(themedContext).also {
|
||||||
animationWindowView.addView(
|
animationWindowView.addView(
|
||||||
it.view,
|
it.view,
|
||||||
layoutParamsDefault(
|
layoutParamsDefault(
|
||||||
@@ -221,7 +223,8 @@ class SystemEventChipAnimationController @Inject constructor(
|
|||||||
|
|
||||||
private fun init() {
|
private fun init() {
|
||||||
initialized = true
|
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
|
.inflate(R.layout.system_event_animation_window, null) as FrameLayout
|
||||||
val lp = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
val lp = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
||||||
lp.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
lp.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
|
|||||||
Reference in New Issue
Block a user