}
private Animation createAspectScaledThumbnailEnterNonFullscreenAnimationLocked(
- Rect containingFrame, @Nullable Rect surfaceInsets, int taskId) {
+ Rect frame, @Nullable Rect surfaceInsets, int taskId) {
getNextAppTransitionStartRect(taskId, mTmpStartRect);
- float width = containingFrame.width();
- float height = containingFrame.height();
+ float width = frame.width();
+ float height = frame.height();
float scaleWidth = mTmpStartRect.width() / width;
float scaleHeight = mTmpStartRect.height() / height;
AnimationSet set = new AnimationSet(true);
ScaleAnimation scale = new ScaleAnimation(scaleWidth, 1, scaleHeight, 1,
(width + surfaceInsetsHorizontal) / 2, (height + surfaceInsetsVertical) / 2);
int fromX = mTmpStartRect.left + mTmpStartRect.width() / 2
- - (containingFrame.left + containingFrame.width() / 2);
+ - (frame.left + frame.width() / 2);
int fromY = mTmpStartRect.top + mTmpStartRect.height() / 2
- - (containingFrame.top + containingFrame.height() / 2);
+ - (frame.top + frame.height() / 2);
TranslateAnimation translation = new TranslateAnimation(fromX, 0, fromY, 0);
set.addAnimation(scale);
set.addAnimation(translation);
Rect appFrame = new Rect(0, 0, width, height);
Rect surfaceInsets = null;
final boolean fullscreen = win != null && win.isFullscreen(width, height);
- // Dialog activities have windows with containing frame being very large, but not
- // exactly fullscreen and much smaller mFrame. We use this distinction to identify
- // dialog activities.
- final boolean dialogWindow = win != null && !win.mContainingFrame.equals(win.mFrame);
+ final boolean freeform = win != null && win.inFreeformWorkspace();
if (win != null) {
- containingFrame.set(win.mContainingFrame);
+ // Containing frame will usually cover the whole screen, including dialog windows.
+ // For freeform workspace windows it will not cover the whole screen and it also
+ // won't exactly match the final freeform window frame (e.g. when overlapping with
+ // the status bar). In that case we need to use the final frame.
+ if (freeform) {
+ containingFrame.set(win.mFrame);
+ } else {
+ containingFrame.set(win.mContainingFrame);
+ }
surfaceInsets = win.getAttrs().surfaceInsets;
if (fullscreen) {
// For fullscreen windows use the window frames and insets to set the thumbnail
// screen gets the enter animation. Both appear in the mOpeningApps set.
enter = false;
}
- final boolean resizedWindow = !fullscreen && !dialogWindow;
Animation a = mAppTransition.loadAnimation(lp, transit, enter, containingWidth,
containingHeight, mCurConfiguration.orientation, containingFrame, contentInsets,
- surfaceInsets, appFrame, isVoiceInteraction, resizedWindow,
- atoken.mTask.mTaskId);
+ surfaceInsets, appFrame, isVoiceInteraction, freeform, atoken.mTask.mTaskId);
if (a != null) {
if (DEBUG_ANIM) {
RuntimeException e = null;