From 1f458fb6a1fbb8ec693d10f195b99310bcfd34d0 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Fri, 25 Mar 2016 17:36:37 -0700 Subject: [PATCH] More transition fixes - Set correct clip mode for clip reveal animation - When moving downwards on a curved path, go down first and then horizontal. Bug: 27154882 Bug: 27607141 Bug: 26559810 Change-Id: I0efc073990f7b6a88746ca1e5c68b1fdb0db116d --- .../core/java/com/android/server/wm/AppTransition.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java index 15a2691386588..d6842787eef5d 100644 --- a/services/core/java/com/android/server/wm/AppTransition.java +++ b/services/core/java/com/android/server/wm/AppTransition.java @@ -996,7 +996,14 @@ public class AppTransition implements Dump { private Path createCurvedPath(float fromX, float toX, float fromY, float toY) { final Path path = new Path(); path.moveTo(fromX, fromY); - path.cubicTo(fromX, fromY, toX, 0.9f * fromY + 0.1f * toY, toX, toY); + + if (fromY > toY) { + // If the object needs to go up, move it in horizontal direction first, then vertical. + path.cubicTo(fromX, fromY, toX, 0.9f * fromY + 0.1f * toY, toX, toY); + } else { + // If the object needs to go down, move it in vertical direction first, then horizontal. + path.cubicTo(fromX, fromY, fromX, 0.1f * fromY + 0.9f * toY, toX, toY); + } return path; } @@ -1557,6 +1564,7 @@ public class AppTransition implements Dump { int getAppStackClipMode() { return mNextAppTransition == TRANSIT_ACTIVITY_RELAUNCH || mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS + || mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL ? STACK_CLIP_NONE : STACK_CLIP_AFTER_ANIM; }