diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-04-30 19:16:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-30 19:16:34 +0000 |
commit | 2e6f3c73245f71c98a8a3228770acca96df971ec (patch) | |
tree | f9ed6a411f6b90ce4b89abb9f18921735283ed21 | |
parent | d9c0fe130b2273bc012746fe21b34d47b06d4af5 (diff) | |
parent | 063211f620595f1258518d0cecfa9c57d41853b9 (diff) | |
download | android_packages_apps_Trebuchet-2e6f3c73245f71c98a8a3228770acca96df971ec.tar.gz android_packages_apps_Trebuchet-2e6f3c73245f71c98a8a3228770acca96df971ec.tar.bz2 android_packages_apps_Trebuchet-2e6f3c73245f71c98a8a3228770acca96df971ec.zip |
Merge "Fix app open animation in landscape." into ub-launcher3-qt-dev
-rw-r--r-- | quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/views/FloatingIconView.java | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java index 886dcc3de..a8666f9da 100644 --- a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java @@ -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)) { diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index f2fc7182a..77f278a19 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -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. - mBgDrawableBounds.offsetTo(mBgDrawableBounds.left, - (int) (mFinalDrawableBounds.top * scale)); + 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); |