From 8ca8c7b43d0b9c97a379b1e286437498873893c8 Mon Sep 17 00:00:00 2001 From: Jordan Demeulenaere Date: Fri, 18 Feb 2022 14:49:02 +0100 Subject: [PATCH] Fix the new QS footer buttons animation This CL fixes the animation triggered when opening an app/dialog from one of the new QS buttons. Before this CL, the background of those buttons was oval and therefore can't animate its radius. This CL changes the oval shape by a rounded rectangle so that it can properly animate the radius of the background. Bug: 217196619 Test: Manual Change-Id: I77ebbb9be62b3457844e06803ab3ce7b9af5d594 --- .../android/systemui/animation/ActivityLaunchAnimator.kt | 3 +++ .../android/systemui/animation/DialogLaunchAnimator.kt | 6 ++++++ .../SystemUI/res/drawable/qs_footer_action_circle.xml | 8 ++++++-- .../res/drawable/qs_footer_action_circle_color.xml | 8 ++++++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt index c3f6a5d18b74d..0da60f0b3d660 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt @@ -298,6 +298,9 @@ class ActivityLaunchAnimator( * * Important: The view must be attached to a [ViewGroup] when calling this function and * during the animation. For safety, this method will return null when it is not. + * + * Note: The background of [view] should be a (rounded) rectangle so that it can be + * properly animated. */ @JvmStatic fun fromView(view: View, cujType: Int? = null): Controller? { diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt index a3c5649e3fecf..50178f470fd89 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt @@ -79,6 +79,9 @@ class DialogLaunchAnimator @JvmOverloads constructor( * If [animateBackgroundBoundsChange] is true, then the background of the dialog will be * animated when the dialog bounds change. * + * Note: The background of [view] should be a (rounded) rectangle so that it can be properly + * animated. + * * Caveats: When calling this function and [dialog] is not a fullscreen dialog, then it will be * made fullscreen and 2 views will be inserted between the dialog DecorView and its children. */ @@ -153,6 +156,9 @@ class DialogLaunchAnimator @JvmOverloads constructor( * activity started, when the dialog to app animation is done (or when it is cancelled). If this * method returns null, then the dialog won't be dismissed. * + * Note: The background of [view] should be a (rounded) rectangle so that it can be properly + * animated. + * * @param view any view inside the dialog to animate. */ @JvmOverloads diff --git a/packages/SystemUI/res/drawable/qs_footer_action_circle.xml b/packages/SystemUI/res/drawable/qs_footer_action_circle.xml index d057f5f32dc4a..31a8c3bc23974 100644 --- a/packages/SystemUI/res/drawable/qs_footer_action_circle.xml +++ b/packages/SystemUI/res/drawable/qs_footer_action_circle.xml @@ -19,13 +19,17 @@ - + + + + - + + diff --git a/packages/SystemUI/res/drawable/qs_footer_action_circle_color.xml b/packages/SystemUI/res/drawable/qs_footer_action_circle_color.xml index 944061cc8e701..021a85f6a244d 100644 --- a/packages/SystemUI/res/drawable/qs_footer_action_circle_color.xml +++ b/packages/SystemUI/res/drawable/qs_footer_action_circle_color.xml @@ -19,13 +19,17 @@ - + + + + - + +