am c7e56e9d: Merge "Take into account scroll offset for transition animation" into mnc-dev
* commit 'c7e56e9df155b678e604ad6402150397d2665f95': Take into account scroll offset for transition animation
This commit is contained in:
@@ -476,9 +476,8 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
|
|||||||
tempRect.set(0, 0, width, height);
|
tempRect.set(0, 0, width, height);
|
||||||
view.getMatrix().mapRect(tempRect);
|
view.getMatrix().mapRect(tempRect);
|
||||||
|
|
||||||
ViewGroup parent = (ViewGroup) view.getParent();
|
left = leftInParent - tempRect.left;
|
||||||
left = leftInParent - tempRect.left + parent.getScrollX();
|
top = topInParent - tempRect.top;
|
||||||
top = topInParent - tempRect.top + parent.getScrollY();
|
|
||||||
right = left + width;
|
right = left + width;
|
||||||
bottom = top + height;
|
bottom = top + height;
|
||||||
}
|
}
|
||||||
@@ -506,7 +505,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
|
|||||||
ViewGroup parent = (ViewGroup) view.getParent();
|
ViewGroup parent = (ViewGroup) view.getParent();
|
||||||
Matrix matrix = new Matrix();
|
Matrix matrix = new Matrix();
|
||||||
parent.transformMatrixToLocal(matrix);
|
parent.transformMatrixToLocal(matrix);
|
||||||
|
matrix.postTranslate(parent.getScrollX(), parent.getScrollY());
|
||||||
mSharedElementParentMatrices.add(matrix);
|
mSharedElementParentMatrices.add(matrix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -521,6 +520,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
|
|||||||
// Find the location in the view's parent
|
// Find the location in the view's parent
|
||||||
ViewGroup parent = (ViewGroup) viewParent;
|
ViewGroup parent = (ViewGroup) viewParent;
|
||||||
parent.transformMatrixToLocal(matrix);
|
parent.transformMatrixToLocal(matrix);
|
||||||
|
matrix.postTranslate(parent.getScrollX(), parent.getScrollY());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// The indices of mSharedElementParentMatrices matches the
|
// The indices of mSharedElementParentMatrices matches the
|
||||||
|
|||||||
Reference in New Issue
Block a user