Merge "Prevent arrow popup from going off screen bottom when below icon." into tm-dev am: 65df4506bf am: d9319683ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17707263 Change-Id: I8edb41e4e42d70d379638778d6e7c88b4e97c7a8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -602,6 +602,7 @@ public abstract class ArrowPopup<T extends Context & ActivityContext>
|
|||||||
mIsAboveIcon = y > dragLayer.getTop() + insets.top;
|
mIsAboveIcon = y > dragLayer.getTop() + insets.top;
|
||||||
if (!mIsAboveIcon) {
|
if (!mIsAboveIcon) {
|
||||||
y = mTempRect.top + iconHeight + extraVerticalSpace;
|
y = mTempRect.top + iconHeight + extraVerticalSpace;
|
||||||
|
height -= extraVerticalSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insets are added later, so subtract them now.
|
// Insets are added later, so subtract them now.
|
||||||
@@ -609,7 +610,7 @@ public abstract class ArrowPopup<T extends Context & ActivityContext>
|
|||||||
y -= insets.top;
|
y -= insets.top;
|
||||||
|
|
||||||
mGravity = 0;
|
mGravity = 0;
|
||||||
if (y + height > dragLayer.getBottom() - insets.bottom) {
|
if ((insets.top + y + height) > (dragLayer.getBottom() - insets.bottom)) {
|
||||||
// The container is opening off the screen, so just center it in the drag layer instead.
|
// The container is opening off the screen, so just center it in the drag layer instead.
|
||||||
mGravity = Gravity.CENTER_VERTICAL;
|
mGravity = Gravity.CENTER_VERTICAL;
|
||||||
// Put the container next to the icon, preferring the right side in ltr (left in rtl).
|
// Put the container next to the icon, preferring the right side in ltr (left in rtl).
|
||||||
|
|||||||
Reference in New Issue
Block a user