Merge "Ensure Gesture Nav Edu animation scales to fit different screen sizes" into udc-qpr-dev

This commit is contained in:
Saumya Prakash authored and Android (Google) Code Review committed 2023-09-01 23:49:30 +00:00
commit 15b0c9ea54
1 file changed
+3 -5
@@ -226,13 +226,11 @@ abstract class TutorialController implements BackGestureAttemptCallback,
return;
}
Matrix scaleMatrix = new Matrix();
float pivotX = mScreenWidth / 2f;
float pivotY = mScreenHeight;
float scaleFactor = mScreenWidth / animationBoundsRect.width();
float heightTranslate = (mScreenHeight - (scaleFactor * animationBoundsRect.height()));
scaleMatrix.postScale(scaleFactor, scaleFactor, pivotX, pivotY);
scaleMatrix.postTranslate(0,
mTutorialFragment.getDeviceProfile().heightPx - animationBoundsRect.height());
scaleMatrix.postScale(scaleFactor, scaleFactor);
scaleMatrix.postTranslate(0, heightTranslate);
mAnimatedGestureDemonstration.setImageMatrix(scaleMatrix);
}