diff options
| author | Doris Liu <tianliu@google.com> | 2015-05-01 11:02:01 -0700 |
|---|---|---|
| committer | Doris Liu <tianliu@google.com> | 2015-05-07 09:58:02 -0700 |
| commit | 18c2b0ef36400f4af6ee38dd84e2d65d18474b20 (patch) | |
| tree | 0927e13ffb09afb0bbb03413d72a94e06bc2be6c /core/java/android | |
| parent | 729d0a06eaaa40f5be4d9dc5bd580f525ba8360e (diff) | |
Take into account scroll offset for transition animation
This CL fixed the issue where scroll offset was ignored when shared
elements are added to the ghost view and when they are laid out.
Bug: 20349408
Change-Id: Ifaeb821bffe6fcfe303221a1732125bf1c4a91b7
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ActivityTransitionCoordinator.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java index 2939322766e2..968c956607a2 100644 --- a/core/java/android/app/ActivityTransitionCoordinator.java +++ b/core/java/android/app/ActivityTransitionCoordinator.java @@ -476,9 +476,8 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { tempRect.set(0, 0, width, height); view.getMatrix().mapRect(tempRect); - ViewGroup parent = (ViewGroup) view.getParent(); - left = leftInParent - tempRect.left + parent.getScrollX(); - top = topInParent - tempRect.top + parent.getScrollY(); + left = leftInParent - tempRect.left; + top = topInParent - tempRect.top; right = left + width; bottom = top + height; } @@ -506,7 +505,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { ViewGroup parent = (ViewGroup) view.getParent(); Matrix matrix = new Matrix(); parent.transformMatrixToLocal(matrix); - + matrix.postTranslate(parent.getScrollX(), parent.getScrollY()); mSharedElementParentMatrices.add(matrix); } } @@ -521,6 +520,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { // Find the location in the view's parent ViewGroup parent = (ViewGroup) viewParent; parent.transformMatrixToLocal(matrix); + matrix.postTranslate(parent.getScrollX(), parent.getScrollY()); } } else { // The indices of mSharedElementParentMatrices matches the |
