Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad71aa40 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge "Ensure that ghosted view is attached when calculating its matrix." into sc-v2-dev

parents 8172fc3e d2dc3133
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -209,8 +209,13 @@ open class GhostedViewLaunchAnimatorController(
        val heightRatio = state.height.toFloat() / ghostedViewState.height
        val scale = min(widthRatio, heightRatio)

        launchContainer.getLocationOnScreen(launchContainerLocation)
        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)
        ghostViewMatrix.postScale(
            scale, scale,
            ghostedViewState.centerX - launchContainerLocation[0],