From 0b9512f6e88bf752d69f89e7d9e9195835d36c85 Mon Sep 17 00:00:00 2001 From: Jordan Demeulenaere Date: Tue, 1 Feb 2022 17:28:23 +0100 Subject: [PATCH] Animate power menu dialog from power button This CL animates the power menu dialog from the power menu button instead of from the bottom. The animation has the same spec as the device default dialog animation (see http://ag/16769344), except for the direction of the translation. Note that this does not support devices that don't have the power button on the right. I will add support for that in a follow-up CL. See b/213872558#comment3 for a video. Bug: 213872558 Test: Manual Change-Id: I7d5f7d9f2ed2375814cb827275728ef9890a50ae --- core/res/res/anim/popup_enter_material.xml | 2 +- core/res/res/anim/popup_exit_material.xml | 2 +- core/res/res/values/dimens.xml | 4 + core/res/res/values/symbols.xml | 4 + packages/SystemUI/res/values/styles.xml | 5 + .../GlobalActionsDialogLite.java | 96 +++++++++++++++++++ .../animation/DialogLaunchAnimatorTest.kt | 29 +++++- 7 files changed, 137 insertions(+), 5 deletions(-) diff --git a/core/res/res/anim/popup_enter_material.xml b/core/res/res/anim/popup_enter_material.xml index ef5b7c05191b1..9f771b9bc0ee7 100644 --- a/core/res/res/anim/popup_enter_material.xml +++ b/core/res/res/anim/popup_enter_material.xml @@ -22,7 +22,7 @@ android:interpolator="@interpolator/standard" android:duration="@android:integer/config_activityDefaultDur" /> diff --git a/core/res/res/anim/popup_exit_material.xml b/core/res/res/anim/popup_exit_material.xml index 1efa7021791ea..2b79ddfa38d24 100644 --- a/core/res/res/anim/popup_exit_material.xml +++ b/core/res/res/anim/popup_exit_material.xml @@ -23,7 +23,7 @@ android:duration="@android:integer/config_activityShortDur" /> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 39b41b587a336..744c3dab9510a 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -994,4 +994,8 @@ 190dp + + + 20dp + -10dp diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index f531c3abc98ed..e7eeecc2b516c 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2358,6 +2358,10 @@ + + + + diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index b98354523e942..09ae3f9e3376b 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -399,6 +399,11 @@ true @android:color/transparent + + + + + @null