OSDN Git Service

Fix screen rotation animation
authorJorim Jaggi <jjaggi@google.com>
Sat, 2 Apr 2016 01:20:33 +0000 (18:20 -0700)
committerJorim Jaggi <jjaggi@google.com>
Mon, 4 Apr 2016 20:30:26 +0000 (20:30 +0000)
Bug: 25019187
Change-Id: I65b5a76147b93e081466035bfc3cce0c9473610e

services/core/java/com/android/server/wm/WindowStateAnimator.java

index 1e103f0..8fd8bc0 100644 (file)
@@ -967,13 +967,15 @@ class WindowStateAnimator {
             if (appTransformation != null) {
                 tmpMatrix.postConcat(appTransformation.getMatrix());
             }
-            if (screenAnimation) {
-                tmpMatrix.postConcat(screenRotationAnimation.getEnterTransformation().getMatrix());
-            }
+
             // The translation that applies the position of the window needs to be applied at the
             // end in case that other translations include scaling. Otherwise the scaling will
-            // affect this translation.
+            // affect this translation. But it needs to be set before the screen rotation animation
+            // so the pivot point is at the center of the screen for all windows.
             tmpMatrix.postTranslate(frame.left + mWin.mXOffset, frame.top + mWin.mYOffset);
+            if (screenAnimation) {
+                tmpMatrix.postConcat(screenRotationAnimation.getEnterTransformation().getMatrix());
+            }
 
             //TODO (multidisplay): Magnification is supported only for the default display.
             if (mService.mAccessibilityController != null && displayId == DEFAULT_DISPLAY) {