Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32b52ced authored by Tony Wickham's avatar Tony Wickham Committed by Automerger Merge Worker
Browse files

Fix tracking window being slightly off when swiping from an app am: 94be66ac

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12172317

Change-Id: I4c69a9ff4d8398e873ac5aea37c565d13a626c95
parents a587387a 94be66ac
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -49,9 +49,7 @@ public class LayoutUtils {
            Rect taskSize = new Rect();
            LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize,
                    orientationHandler);
            return (orientationHandler.getSecondaryValue(dp.widthPx, dp.heightPx)
                    - orientationHandler.getSecondaryValue(taskSize.width(), taskSize.height()))
                    / 2;
            return orientationHandler.getDistanceToBottomOfRect(dp, taskSize);
        }
        int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
        int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension(
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.launcher3.touch;

import static android.widget.ListPopupWindow.WRAP_CONTENT;

import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
import static com.android.launcher3.touch.SingleAxisSwipeDetector.HORIZONTAL;
@@ -33,6 +34,7 @@ import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.widget.LinearLayout;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.PagedView;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.OverScroller;
@@ -260,4 +262,10 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
        }
        return new ChildBounds(childHeight, childWidth, childBottom, childLeft);
    }

    @SuppressWarnings("SuspiciousNameCombination")
    @Override
    public int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect) {
        return rect.left;
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ public interface PagedOrientationHandler {
    int getTaskMenuWidth(View view);
    int getTaskMenuLayoutOrientation(LinearLayout taskMenuLayout);
    void setLayoutParamsForTaskMenuOptionItem(LinearLayout.LayoutParams lp);
    int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect);

    /**
     * Maps the velocity from the coordinate plane of the foreground app to that
+6 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.widget.LinearLayout;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.PagedView;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.OverScroller;
@@ -257,4 +258,9 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
        }
        return new ChildBounds(childWidth, childHeight, childRight, childTop);
    }

    @Override
    public int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect) {
        return dp.heightPx - rect.bottom;
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -18,9 +18,11 @@ package com.android.launcher3.touch;

import android.content.res.Resources;
import android.graphics.PointF;
import android.graphics.Rect;
import android.view.Surface;
import android.view.View;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;

public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
@@ -77,4 +79,9 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
        view.setTranslationX(0);
        view.setTranslationY(translation);
    }

    @Override
    public int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect) {
        return dp.widthPx - rect.right;
    }
}