summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2017-07-20 21:00:03 +0000
committerHyunyoung Song <hyunyoungs@google.com>2017-07-20 21:00:03 +0000
commit6dc62fb2d427d5c841ab6c8f8552fd57ee1d4b38 (patch)
tree032b039ed0b0c1f3b39b0f23131b56fc9be58a16 /src
parent70999fef4bc37bcf32556e2de23ec115dbd30cf8 (diff)
parent27790352a3eaa64fef2ca0087526f17947fdca6e (diff)
downloadandroid_packages_apps_Trebuchet-6dc62fb2d427d5c841ab6c8f8552fd57ee1d4b38.tar.gz
android_packages_apps_Trebuchet-6dc62fb2d427d5c841ab6c8f8552fd57ee1d4b38.tar.bz2
android_packages_apps_Trebuchet-6dc62fb2d427d5c841ab6c8f8552fd57ee1d4b38.zip
separate enforceContainerWithinScreen logic to a private method am: 27790352a3
Change-Id: I965c403341a9bca872a0d14c455e25aa254cf41e
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java9
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;
}