Merge "Ensure that ghosted view is attached when calculating its matrix." into sc-v2-dev am: ad71aa409d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16048150 Change-Id: I99d25820c9d95c59dff5b4a8c7c0b02b2486f42d
This commit is contained in:
committed by
Automerger Merge Worker
commit
fce72425a0
@@ -209,8 +209,13 @@ open class GhostedViewLaunchAnimatorController(
|
|||||||
val heightRatio = state.height.toFloat() / ghostedViewState.height
|
val heightRatio = state.height.toFloat() / ghostedViewState.height
|
||||||
val scale = min(widthRatio, heightRatio)
|
val scale = min(widthRatio, heightRatio)
|
||||||
|
|
||||||
|
if (ghostedView.parent is ViewGroup) {
|
||||||
|
// Recalculate the matrix in case the ghosted view moved. We ensure that the ghosted
|
||||||
|
// view is still attached to a ViewGroup, otherwise calculateMatrix will throw.
|
||||||
|
GhostView.calculateMatrix(ghostedView, launchContainer, ghostViewMatrix)
|
||||||
|
}
|
||||||
|
|
||||||
launchContainer.getLocationOnScreen(launchContainerLocation)
|
launchContainer.getLocationOnScreen(launchContainerLocation)
|
||||||
GhostView.calculateMatrix(ghostedView, launchContainer, ghostViewMatrix)
|
|
||||||
ghostViewMatrix.postScale(
|
ghostViewMatrix.postScale(
|
||||||
scale, scale,
|
scale, scale,
|
||||||
ghostedViewState.centerX - launchContainerLocation[0],
|
ghostedViewState.centerX - launchContainerLocation[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user