diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-07-01 15:07:36 -0700 |
---|---|---|
committer | Wale Ogunwale <ogunwale@google.com> | 2015-07-07 08:40:43 -0700 |
commit | 35a57f81a963eaa3739cfcacd4f9f309d433487f (patch) | |
tree | c6d01b1593c485d20fd1afc31a76b646250bf8cf /services/core/java/com/android/server/wm/AppTransition.java | |
parent | 7fe86c4753e88058a7f1a1bf8d0302df9a64bd2e (diff) | |
download | frameworks_base-35a57f81a963eaa3739cfcacd4f9f309d433487f.zip frameworks_base-35a57f81a963eaa3739cfcacd4f9f309d433487f.tar.gz frameworks_base-35a57f81a963eaa3739cfcacd4f9f309d433487f.tar.bz2 |
Cleaned-up logic for determining clip rect for transitions animations.
Previous logic led to several edge cases which fixes sometimes broke
other edge cases. New logic uses the clip rect provided by the
transformation as-is and doesn't try to adjust it based on window
flags. Correct clip rect is set in
WindowManagerService#applyAnimationLock using the content insets
before the animation is loaded.
Bug: 21727851
Bug: 20652683
Bug: 19523205
Bug: 15046646
https://code.google.com/p/android/issues/detail?id=161362
Change-Id: I2d4ed6196edb8ee8c401fe9a242aec70d3494574
Diffstat (limited to 'services/core/java/com/android/server/wm/AppTransition.java')
-rw-r--r-- | services/core/java/com/android/server/wm/AppTransition.java | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java index 0eee815..a57463c 100644 --- a/services/core/java/com/android/server/wm/AppTransition.java +++ b/services/core/java/com/android/server/wm/AppTransition.java @@ -715,7 +715,7 @@ public class AppTransition implements Dump { */ Animation createAspectScaledThumbnailEnterExitAnimationLocked(int thumbTransitState, int appWidth, int appHeight, int orientation, int transit, Rect containingFrame, - Rect contentInsets, boolean isFullScreen) { + Rect contentInsets) { Animation a; final int thumbWidthI = mNextAppTransitionStartWidth; final float thumbWidth = thumbWidthI > 0 ? thumbWidthI : 1; @@ -735,9 +735,6 @@ public class AppTransition implements Dump { scaledTopDecor = (int) (scale * contentInsets.top); int unscaledThumbHeight = (int) (thumbHeight / scale); mTmpFromClipRect.set(containingFrame); - if (isFullScreen) { - mTmpFromClipRect.top = contentInsets.top; - } mTmpFromClipRect.bottom = (mTmpFromClipRect.top + unscaledThumbHeight); mTmpToClipRect.set(containingFrame); } else { @@ -745,15 +742,13 @@ public class AppTransition implements Dump { scale = thumbHeight / (appHeight - contentInsets.top); scaledTopDecor = (int) (scale * contentInsets.top); int unscaledThumbWidth = (int) (thumbWidth / scale); - int unscaledThumbHeight = (int) (thumbHeight / scale); mTmpFromClipRect.set(containingFrame); - if (isFullScreen) { - mTmpFromClipRect.top = contentInsets.top; - mTmpFromClipRect.bottom = (mTmpFromClipRect.top + unscaledThumbHeight); - } mTmpFromClipRect.right = (mTmpFromClipRect.left + unscaledThumbWidth); mTmpToClipRect.set(containingFrame); } + // exclude top screen decor (status bar) region from the source clip. + mTmpFromClipRect.top = contentInsets.top; + mNextAppTransitionInsets.set(contentInsets); Animation scaleAnim = new ScaleAnimation(scale, 1, scale, 1, @@ -800,24 +795,19 @@ public class AppTransition implements Dump { int unscaledThumbHeight = (int) (thumbHeight / scale); mTmpFromClipRect.set(containingFrame); mTmpToClipRect.set(containingFrame); - if (isFullScreen) { - mTmpToClipRect.top = contentInsets.top; - } mTmpToClipRect.bottom = (mTmpToClipRect.top + unscaledThumbHeight); } else { // In landscape, we scale the height and clip to the top/left square scale = thumbHeight / (appHeight - contentInsets.top); scaledTopDecor = (int) (scale * contentInsets.top); int unscaledThumbWidth = (int) (thumbWidth / scale); - int unscaledThumbHeight = (int) (thumbHeight / scale); mTmpFromClipRect.set(containingFrame); mTmpToClipRect.set(containingFrame); - if (isFullScreen) { - mTmpToClipRect.top = contentInsets.top; - mTmpToClipRect.bottom = (mTmpToClipRect.top + unscaledThumbHeight); - } mTmpToClipRect.right = (mTmpToClipRect.left + unscaledThumbWidth); } + // exclude top screen decor (status bar) region from the destination clip. + mTmpToClipRect.top = contentInsets.top; + mNextAppTransitionInsets.set(contentInsets); Animation scaleAnim = new ScaleAnimation(1, scale, 1, scale, @@ -963,7 +953,7 @@ public class AppTransition implements Dump { Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter, int appWidth, int appHeight, int orientation, Rect containingFrame, Rect contentInsets, - Rect appFrame, boolean isFullScreen, boolean isVoiceInteraction) { + Rect appFrame, boolean isVoiceInteraction) { Animation a; if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_OPEN || transit == TRANSIT_TASK_OPEN @@ -1033,7 +1023,7 @@ public class AppTransition implements Dump { (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP); a = createAspectScaledThumbnailEnterExitAnimationLocked( getThumbnailTransitionState(enter), appWidth, appHeight, orientation, - transit, containingFrame, contentInsets, isFullScreen); + transit, containingFrame, contentInsets); if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) { String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_ASPECT_SCALE_UP" : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN"; |