Search in sources :

Example 1 with TaskIdAttributeContainer

use of com.android.quickstep.views.TaskView.TaskIdAttributeContainer in project android_packages_apps_404Launcher by P-404.

the class TaskMenuView method setPosition.

private void setPosition(float x, float y, int overscrollShift) {
    PagedOrientationHandler pagedOrientationHandler = mTaskView.getPagedOrientationHandler();
    // Inset due to margin
    PointF additionalInset = pagedOrientationHandler.getAdditionalInsetForTaskMenu(mTaskInsetMargin);
    DeviceProfile deviceProfile = mActivity.getDeviceProfile();
    int taskTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
    float adjustedY = y + taskTopMargin - additionalInset.y;
    float adjustedX = x - additionalInset.x;
    // Changing pivot to make computations easier
    // NOTE: Changing the pivots means the rotated view gets rotated about the new pivots set,
    // which would render the X and Y position set here incorrect
    setPivotX(0);
    if (deviceProfile.overviewShowAsGrid) {
        // In tablet, set pivotY to original position without mThumbnailTopMargin adjustment.
        setPivotY(-taskTopMargin);
    } else {
        setPivotY(0);
    }
    setRotation(pagedOrientationHandler.getDegreesRotated());
    setX(pagedOrientationHandler.getTaskMenuX(adjustedX, mTaskContainer.getThumbnailView(), overscrollShift, deviceProfile));
    setY(pagedOrientationHandler.getTaskMenuY(adjustedY, mTaskContainer.getThumbnailView(), overscrollShift));
    // TODO(b/193432925) temporary menu placement for split screen task menus
    TaskIdAttributeContainer[] taskIdAttributeContainers = mTaskView.getTaskIdAttributeContainers();
    if (taskIdAttributeContainers[0].getStagePosition() != STAGE_POSITION_UNDEFINED) {
        if (mTaskContainer.getStagePosition() != STAGE_POSITION_BOTTOM_OR_RIGHT) {
            return;
        }
        Rect r = new Rect();
        mTaskContainer.getThumbnailView().getBoundsOnScreen(r);
        if (deviceProfile.isLandscape) {
            setX(r.left);
        } else {
            setY(r.top);
        }
    }
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) Rect(android.graphics.Rect) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) TaskIdAttributeContainer(com.android.quickstep.views.TaskView.TaskIdAttributeContainer) PointF(android.graphics.PointF)

Example 2 with TaskIdAttributeContainer

use of com.android.quickstep.views.TaskView.TaskIdAttributeContainer in project android_packages_apps_Launcher3 by ArrowOS.

the class TaskMenuView method setPosition.

private void setPosition(float x, float y, int overscrollShift) {
    PagedOrientationHandler pagedOrientationHandler = mTaskView.getPagedOrientationHandler();
    // Inset due to margin
    PointF additionalInset = pagedOrientationHandler.getAdditionalInsetForTaskMenu(mTaskInsetMargin);
    DeviceProfile deviceProfile = mActivity.getDeviceProfile();
    int taskTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
    float adjustedY = y + taskTopMargin - additionalInset.y;
    float adjustedX = x - additionalInset.x;
    // Changing pivot to make computations easier
    // NOTE: Changing the pivots means the rotated view gets rotated about the new pivots set,
    // which would render the X and Y position set here incorrect
    setPivotX(0);
    if (deviceProfile.overviewShowAsGrid) {
        // In tablet, set pivotY to original position without mThumbnailTopMargin adjustment.
        setPivotY(-taskTopMargin);
    } else {
        setPivotY(0);
    }
    setRotation(pagedOrientationHandler.getDegreesRotated());
    setX(pagedOrientationHandler.getTaskMenuX(adjustedX, mTaskContainer.getThumbnailView(), overscrollShift, deviceProfile));
    setY(pagedOrientationHandler.getTaskMenuY(adjustedY, mTaskContainer.getThumbnailView(), overscrollShift));
    // TODO(b/193432925) temporary menu placement for split screen task menus
    TaskIdAttributeContainer[] taskIdAttributeContainers = mTaskView.getTaskIdAttributeContainers();
    if (taskIdAttributeContainers[0].getStagePosition() != STAGE_POSITION_UNDEFINED) {
        if (mTaskContainer.getStagePosition() != STAGE_POSITION_BOTTOM_OR_RIGHT) {
            return;
        }
        Rect r = new Rect();
        mTaskContainer.getThumbnailView().getBoundsOnScreen(r);
        if (deviceProfile.isLandscape) {
            setX(r.left);
        } else {
            setY(r.top);
        }
    }
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) Rect(android.graphics.Rect) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) TaskIdAttributeContainer(com.android.quickstep.views.TaskView.TaskIdAttributeContainer) PointF(android.graphics.PointF)

Example 3 with TaskIdAttributeContainer

use of com.android.quickstep.views.TaskView.TaskIdAttributeContainer in project android_packages_apps_Launcher3 by ProtonAOSP.

the class TaskMenuView method setPosition.

private void setPosition(float x, float y, int overscrollShift) {
    PagedOrientationHandler pagedOrientationHandler = mTaskView.getPagedOrientationHandler();
    // Inset due to margin
    PointF additionalInset = pagedOrientationHandler.getAdditionalInsetForTaskMenu(mTaskInsetMargin);
    DeviceProfile deviceProfile = mActivity.getDeviceProfile();
    int taskTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
    float adjustedY = y + taskTopMargin - additionalInset.y;
    float adjustedX = x - additionalInset.x;
    // Changing pivot to make computations easier
    // NOTE: Changing the pivots means the rotated view gets rotated about the new pivots set,
    // which would render the X and Y position set here incorrect
    setPivotX(0);
    if (deviceProfile.overviewShowAsGrid) {
        // In tablet, set pivotY to original position without mThumbnailTopMargin adjustment.
        setPivotY(-taskTopMargin);
    } else {
        setPivotY(0);
    }
    setRotation(pagedOrientationHandler.getDegreesRotated());
    setX(pagedOrientationHandler.getTaskMenuX(adjustedX, mTaskContainer.getThumbnailView(), overscrollShift, deviceProfile));
    setY(pagedOrientationHandler.getTaskMenuY(adjustedY, mTaskContainer.getThumbnailView(), overscrollShift));
    // TODO(b/193432925) temporary menu placement for split screen task menus
    TaskIdAttributeContainer[] taskIdAttributeContainers = mTaskView.getTaskIdAttributeContainers();
    if (taskIdAttributeContainers[0].getStagePosition() != STAGE_POSITION_UNDEFINED) {
        if (mTaskContainer.getStagePosition() != STAGE_POSITION_BOTTOM_OR_RIGHT) {
            return;
        }
        Rect r = new Rect();
        mTaskContainer.getThumbnailView().getBoundsOnScreen(r);
        if (deviceProfile.isLandscape) {
            setX(r.left);
        } else {
            setY(r.top);
        }
    }
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) Rect(android.graphics.Rect) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) TaskIdAttributeContainer(com.android.quickstep.views.TaskView.TaskIdAttributeContainer) PointF(android.graphics.PointF)

Example 4 with TaskIdAttributeContainer

use of com.android.quickstep.views.TaskView.TaskIdAttributeContainer in project android_packages_apps_Launcher3 by AOSPA.

the class TaskMenuView method setPosition.

private void setPosition(float x, float y, int overscrollShift) {
    PagedOrientationHandler pagedOrientationHandler = mTaskView.getPagedOrientationHandler();
    // Inset due to margin
    PointF additionalInset = pagedOrientationHandler.getAdditionalInsetForTaskMenu(mTaskInsetMargin);
    DeviceProfile deviceProfile = mActivity.getDeviceProfile();
    int taskTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
    float adjustedY = y + taskTopMargin - additionalInset.y;
    float adjustedX = x - additionalInset.x;
    // Changing pivot to make computations easier
    // NOTE: Changing the pivots means the rotated view gets rotated about the new pivots set,
    // which would render the X and Y position set here incorrect
    setPivotX(0);
    if (deviceProfile.overviewShowAsGrid) {
        // In tablet, set pivotY to original position without mThumbnailTopMargin adjustment.
        setPivotY(-taskTopMargin);
    } else {
        setPivotY(0);
    }
    setRotation(pagedOrientationHandler.getDegreesRotated());
    setX(pagedOrientationHandler.getTaskMenuX(adjustedX, mTaskContainer.getThumbnailView(), overscrollShift, deviceProfile));
    setY(pagedOrientationHandler.getTaskMenuY(adjustedY, mTaskContainer.getThumbnailView(), overscrollShift));
    // TODO(b/193432925) temporary menu placement for split screen task menus
    TaskIdAttributeContainer[] taskIdAttributeContainers = mTaskView.getTaskIdAttributeContainers();
    if (taskIdAttributeContainers[0].getStagePosition() != STAGE_POSITION_UNDEFINED) {
        if (mTaskContainer.getStagePosition() != STAGE_POSITION_BOTTOM_OR_RIGHT) {
            return;
        }
        Rect r = new Rect();
        mTaskContainer.getThumbnailView().getBoundsOnScreen(r);
        if (deviceProfile.isLandscape) {
            setX(r.left);
        } else {
            setY(r.top);
        }
    }
}
Also used : DeviceProfile(com.android.launcher3.DeviceProfile) Rect(android.graphics.Rect) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) TaskIdAttributeContainer(com.android.quickstep.views.TaskView.TaskIdAttributeContainer) PointF(android.graphics.PointF)

Aggregations

PointF (android.graphics.PointF)4 Rect (android.graphics.Rect)4 DeviceProfile (com.android.launcher3.DeviceProfile)4 PagedOrientationHandler (com.android.launcher3.touch.PagedOrientationHandler)4 TaskIdAttributeContainer (com.android.quickstep.views.TaskView.TaskIdAttributeContainer)4