Merge "Fix the new QS footer buttons animation" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-02-22 18:44:24 +00:00
committed by Android (Google) Code Review
4 changed files with 21 additions and 4 deletions

View File

@@ -298,6 +298,9 @@ class ActivityLaunchAnimator(
* *
* Important: The view must be attached to a [ViewGroup] when calling this function and * 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. * 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 @JvmStatic
fun fromView(view: View, cujType: Int? = null): Controller? { fun fromView(view: View, cujType: Int? = null): Controller? {

View File

@@ -79,6 +79,9 @@ class DialogLaunchAnimator @JvmOverloads constructor(
* If [animateBackgroundBoundsChange] is true, then the background of the dialog will be * If [animateBackgroundBoundsChange] is true, then the background of the dialog will be
* animated when the dialog bounds change. * 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 * 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. * 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 * 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. * 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. * @param view any view inside the dialog to animate.
*/ */
@JvmOverloads @JvmOverloads

View File

@@ -19,13 +19,17 @@
<ripple <ripple
android:color="?android:attr/colorControlHighlight"> android:color="?android:attr/colorControlHighlight">
<item android:id="@android:id/mask"> <item android:id="@android:id/mask">
<shape android:shape="oval"> <!-- We make this shape a rounded rectangle instead of a oval so that it can animate -->
<!-- properly into an app/dialog. -->
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/> <solid android:color="@android:color/white"/>
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
</shape> </shape>
</item> </item>
<item> <item>
<shape android:shape="oval"> <shape android:shape="rectangle">
<solid android:color="?attr/offStateColor"/> <solid android:color="?attr/offStateColor"/>
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
</shape> </shape>
</item> </item>

View File

@@ -19,13 +19,17 @@
<ripple <ripple
android:color="?android:attr/colorControlHighlight"> android:color="?android:attr/colorControlHighlight">
<item android:id="@android:id/mask"> <item android:id="@android:id/mask">
<shape android:shape="oval"> <!-- We make this shape a rounded rectangle instead of a oval so that it can animate -->
<!-- properly into an app/dialog. -->
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/> <solid android:color="@android:color/white"/>
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
</shape> </shape>
</item> </item>
<item> <item>
<shape android:shape="oval"> <shape android:shape="rectangle">
<solid android:color="?android:attr/colorAccent"/> <solid android:color="?android:attr/colorAccent"/>
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
</shape> </shape>
</item> </item>