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

Commit dd2ff841 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Fix recents <-> full screen animations in landscape.

Somewhere along the way we lost the accounting for system decorations
when calculating the crop of the application window during the
recents to/from full screen app transition. This is necessary,
otherwise the animation starts/ends with a black navigation bar and
there is no sense of continuity with the recents thumbnail.

Change-Id: I75bc77cc4badca40b7c59ded39e0d4f72e36c739
parent 4e51636b
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -778,11 +778,17 @@ public class AppTransition implements Dump {
                        int unscaledThumbHeight = (int) (thumbHeight / scale);
                        mTmpFromClipRect.bottom = mTmpFromClipRect.top + unscaledThumbHeight;
                    } else {
                        // In landscape, we scale the height and clip to the top/left square
                        scale = thumbHeight / (appHeight - contentInsets.top);
                        // In landscape, we scale the height and clip to the top/left square. We
                        // only scale the part that is not covered by status bar and the nav bar.
                        scale = thumbHeight / (appHeight - contentInsets.top
                                - contentInsets.bottom);
                        scaledTopDecor = (int) (scale * contentInsets.top);
                        int unscaledThumbWidth = (int) (thumbWidth / scale);
                        mTmpFromClipRect.right = mTmpFromClipRect.left + unscaledThumbWidth;
                        // This removes the navigation bar from the first frame, so it better
                        // matches the thumbnail. We need to do this explicitly in landscape,
                        // because in portrait we already crop vertically.
                        mTmpFromClipRect.bottom = mTmpFromClipRect.bottom - contentInsets.bottom;
                    }

                    mNextAppTransitionInsets.set(contentInsets);
@@ -836,11 +842,16 @@ public class AppTransition implements Dump {
                    int unscaledThumbHeight = (int) (thumbHeight / scale);
                    mTmpToClipRect.bottom = mTmpToClipRect.top + unscaledThumbHeight;
                } else {
                    // In landscape, we scale the height and clip to the top/left square
                    scale = thumbHeight / (appHeight - contentInsets.top);
                    // In landscape, we scale the height and clip to the top/left square. We only
                    // scale the part that is not covered by status bar and the nav bar.
                    scale = thumbHeight / (appHeight - contentInsets.top - contentInsets.bottom);
                    scaledTopDecor = (int) (scale * contentInsets.top);
                    int unscaledThumbWidth = (int) (thumbWidth / scale);
                    mTmpToClipRect.right = mTmpToClipRect.left + unscaledThumbWidth;
                    // This removes the navigation bar from the last frame, so it better matches the
                    // thumbnail. We need to do this explicitly in landscape, because in portrait we
                    // already crop vertically.
                    mTmpToClipRect.bottom = mTmpToClipRect.bottom - contentInsets.bottom;
                }

                mNextAppTransitionInsets.set(contentInsets);