diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2017-07-24 19:19:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-07-24 19:19:52 +0000 |
commit | f38758de105e584cf6a6a7a9a789fea3b66f33d0 (patch) | |
tree | 07cf2fc620b987c0be816cc9f28792f1ff07e816 | |
parent | 1091e538b4622beb8fade0ca0b050f25019c4fd6 (diff) | |
parent | 27790352a3eaa64fef2ca0087526f17947fdca6e (diff) | |
download | android_packages_apps_Trebuchet-f38758de105e584cf6a6a7a9a789fea3b66f33d0.tar.gz android_packages_apps_Trebuchet-f38758de105e584cf6a6a7a9a789fea3b66f33d0.tar.bz2 android_packages_apps_Trebuchet-f38758de105e584cf6a6a7a9a789fea3b66f33d0.zip |
Merge "separate enforceContainerWithinScreen logic to a private method" into ub-launcher3-dorval-polish
-rw-r--r-- | src/com/android/launcher3/popup/PopupContainerWithArrow.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index f5f7ddb31..c3e2d8b89 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -402,9 +402,14 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); + enforceContainedWithinScreen(l, r); + + } + + private void enforceContainedWithinScreen(int left, int right) { DragLayer dragLayer = mLauncher.getDragLayer(); - if (getTranslationX() + l < 0 || - getTranslationX() + l + getMeasuredWidth() > dragLayer.getWidth()) { + if (getTranslationX() + left < 0 || + getTranslationX() + right > dragLayer.getWidth()) { // If we are still off screen, center horizontally too. mGravity |= Gravity.CENTER_HORIZONTAL; } |