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

Commit bf78c0ba authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow Task menu to draw down to screen bottom" into main

parents eaf5bbd4 26e487c6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -304,6 +304,12 @@ public class LandscapePagedViewHandler implements RecentsPagedOrientationHandler
        }
    }

    @Override
    public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
            float taskMenuX, float taskMenuY) {
        return (int) (taskMenuX - taskInsetMargin);
    }

    @Override
    public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
            LinearLayout taskMenuLayout, int dividerSpacing,
+6 −0
Original line number Diff line number Diff line
@@ -209,6 +209,12 @@ public class PortraitPagedViewHandler extends DefaultPagedViewHandler implements
                : thumbnailView.getMeasuredWidth()) - (2 * padding);
    }

    @Override
    public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
            float taskMenuX, float taskMenuY) {
        return (int) (deviceProfile.availableHeightPx - taskInsetMargin - taskMenuY);
    }

    @Override
    public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
            LinearLayout taskMenuLayout, int dividerSpacing,
+3 −0
Original line number Diff line number Diff line
@@ -176,6 +176,9 @@ public interface RecentsPagedOrientationHandler extends PagedOrientationHandler
            View taskMenuView, float taskInsetMargin, View taskViewIcon);
    int getTaskMenuWidth(View thumbnailView, DeviceProfile deviceProfile,
            @StagePosition int stagePosition);

    int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile, float taskMenuX,
            float taskMenuY);
    /**
     * Sets linear layout orientation for {@link com.android.launcher3.popup.SystemShortcut} items
     * inside task menu view.
+6 −0
Original line number Diff line number Diff line
@@ -113,6 +113,12 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
        }
    }

    @Override
    public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
            float taskMenuX, float taskMenuY) {
        return (int) (deviceProfile.availableWidthPx - taskInsetMargin - taskMenuX);
    }

    @Override
    public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect, SplitBounds splitInfo,
            int desiredStagePosition) {
+5 −8
Original line number Diff line number Diff line
@@ -140,12 +140,10 @@ public class TaskMenuView extends AbstractFloatingView {

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (!enableOverviewIconMenu()) {
        int maxMenuHeight = calculateMaxHeight();
        if (MeasureSpec.getSize(heightMeasureSpec) > maxMenuHeight) {
            heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxMenuHeight, MeasureSpec.AT_MOST);
        }
        }
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

@@ -416,10 +414,9 @@ public class TaskMenuView extends AbstractFloatingView {
     * with a margin on the top and bottom.
     */
    private int calculateMaxHeight() {
        float taskBottom = mTaskView.getHeight() + mTaskView.getPersistentTranslationY();
        float taskInsetMargin = getResources().getDimension(R.dimen.task_card_margin);

        return (int) (taskBottom - taskInsetMargin - getTranslationY());
        return mTaskView.getPagedOrientationHandler().getTaskMenuHeight(taskInsetMargin,
                mActivity.getDeviceProfile(), getTranslationX(), getTranslationY());
    }

    private void setOnClosingStartCallback(Runnable onClosingStartCallback) {