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

Commit 063211f6 authored by Jon Miranda's avatar Jon Miranda
Browse files

Fix app open animation in landscape.

Bug: 130828765
Change-Id: Ic447d05a8fe2097a6afd0bfec73039a62bbf5a4b
parent 287f5d5a
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -422,10 +422,9 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans

        // Scale the app icon to take up the entire screen. This simplifies the math when
        // animating the app window position / scale.
        float maxScaleX = windowTargetBounds.width() / (float) bounds.width();
        // We use windowTargetBounds.width for scaleY too since we start off the animation where the
        // window is clipped to a square.
        float maxScaleY = windowTargetBounds.width() / (float) bounds.height();
        float smallestSize = Math.min(windowTargetBounds.height(), windowTargetBounds.width());
        float maxScaleX = smallestSize / (float) bounds.width();
        float maxScaleY = smallestSize / (float) bounds.height();
        float scale = Math.max(maxScaleX, maxScaleY);
        float startScale = 1f;
        if (v instanceof BubbleTextView && !(v.getParent() instanceof DeepShortcutView)) {
+10 −3
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class FloatingIconView extends View implements Animator.AnimatorListener,

    private final int mBlurSizeOutline;

    private boolean mIsVerticalBarLayout = false;
    private boolean mIsAdaptiveIcon = false;

    private @Nullable Drawable mForeground;
@@ -273,7 +274,7 @@ public class FloatingIconView extends View implements Animator.AnimatorListener,
                }

                float aspectRatio = launcher.getDeviceProfile().aspectRatio;
                if (launcher.getDeviceProfile().isVerticalBarLayout()) {
                if (mIsVerticalBarLayout) {
                    lp.width = (int) Math.max(lp.width, lp.height * aspectRatio);
                } else {
                    lp.height = (int) Math.max(lp.height, lp.width * aspectRatio);
@@ -318,8 +319,13 @@ public class FloatingIconView extends View implements Animator.AnimatorListener,
        mBgDrawableBounds.set(mFinalDrawableBounds);
        Utilities.scaleRectAboutCenter(mBgDrawableBounds, scale);
        // Since the drawable is at the top of the view, we need to offset to keep it centered.
        if (mIsVerticalBarLayout) {
            mBgDrawableBounds.offsetTo((int) (mFinalDrawableBounds.left  * scale),
                    mBgDrawableBounds.top);
        } else {
            mBgDrawableBounds.offsetTo(mBgDrawableBounds.left,
                    (int) (mFinalDrawableBounds.top * scale));
        }
        mBackground.setBounds(mBgDrawableBounds);
    }

@@ -410,6 +416,7 @@ public class FloatingIconView extends View implements Animator.AnimatorListener,
            recycle.recycle();
        }
        FloatingIconView view = recycle != null ? recycle : new FloatingIconView(launcher);
        view.mIsVerticalBarLayout = launcher.getDeviceProfile().isVerticalBarLayout();

        // Match the position of the original view.
        view.matchPositionOf(launcher, originalView, positionOut);