summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2019-04-30 12:03:39 -0700
committerJon Miranda <jonmiranda@google.com>2019-04-30 12:03:39 -0700
commit063211f620595f1258518d0cecfa9c57d41853b9 (patch)
tree990f8451ef0048f46afddc1263365429276b96e6 /src
parent287f5d5aef7638d336a557aa53b90fc1af665079 (diff)
downloadandroid_packages_apps_Trebuchet-063211f620595f1258518d0cecfa9c57d41853b9.tar.gz
android_packages_apps_Trebuchet-063211f620595f1258518d0cecfa9c57d41853b9.tar.bz2
android_packages_apps_Trebuchet-063211f620595f1258518d0cecfa9c57d41853b9.zip
Fix app open animation in landscape.
Bug: 130828765 Change-Id: Ic447d05a8fe2097a6afd0bfec73039a62bbf5a4b
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/views/FloatingIconView.java13
1 files changed, 10 insertions, 3 deletions
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);