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

Commit 3b1f5849 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Update for stashed taskbar animation

* Strangely if you swipe up with a split pair
and then tap on the live tile to go back to
fullscreen this animates fairly correctly.
However, if you drag the focused pair back to fullscreen
the bottom app does not unclip as expected

Bug: 219411750
Test: Swipe up w/ stashed taskbar in portrait.
Thumbnail cutout doesn't appear when dragging to
fullscreen

Change-Id: Ia6e7aae10389d9fefa4adbfce540171bbe0a9180
parent c04120e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -320,6 +320,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {

            // mIsRecentsRtl is the inverse of TaskView RTL.
            boolean isRtlEnabled = !mIsRecentsRtl;
            mPositionHelper.setTaskbarInApp(mDp.isTaskbarPresentInApps);
            mPositionHelper.updateThumbnailMatrix(
                    mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(),
                    mDp.widthPx, mDp.heightPx, mDp.taskbarSize, mDp.isTablet,
+2 −1
Original line number Diff line number Diff line
@@ -464,6 +464,8 @@ public class TaskThumbnailView extends View {
    }

    private void updateThumbnailMatrix() {
        DeviceProfile dp = mActivity.getDeviceProfile();
        mPreviewPositionHelper.setTaskbarInApp(dp.isTaskbarPresentInApps);
        mPreviewPositionHelper.setOrientationChanged(false);
        if (mBitmapShader != null && mThumbnailData != null) {
            mPreviewRect.set(0, 0, mThumbnailData.thumbnail.getWidth(),
@@ -471,7 +473,6 @@ public class TaskThumbnailView extends View {
            int currentRotation = getTaskView().getRecentsView().getPagedViewOrientedState()
                    .getRecentsActivityRotation();
            boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
            DeviceProfile dp = mActivity.getDeviceProfile();
            mPreviewPositionHelper.updateThumbnailMatrix(mPreviewRect, mThumbnailData,
                    getMeasuredWidth(), getMeasuredHeight(), dp.widthPx, dp.heightPx,
                    dp.taskbarSize, dp.isTablet, currentRotation, isRtl);
+28 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.launcher3.DeviceProfileBaseTest
import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT
import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT
import com.android.quickstep.views.TaskView.FullscreenDrawParams
import com.android.systemui.shared.recents.model.ThumbnailData
import com.android.systemui.shared.recents.utilities.PreviewPositionHelper
@@ -103,6 +104,33 @@ class FullscreenDrawParamsTest : DeviceProfileBaseTest() {
                .isWithin(1f).of(expectedBottomHint)
    }

    @Test
    fun setFullProgress_currentDrawnInsets_clipTaskbarSizeFromTopForTablets_splitPortrait() {
        initializeVarsForTablet()
        val dp = newDP()
        val previewRect = Rect(0, 0, 100, 100)
        val canvasWidth = (dp.widthPx * TASK_SCALE).roundToInt()
        val canvasHeight = (dp.heightPx * TASK_SCALE / 2).roundToInt()
        val currentRotation = 0
        val isRtl = false
        // portrait/vertical split apps
        val dividerSize = 10
        val splitBounds = SplitBounds(
                Rect(0, 0, dp.widthPx, (dp.heightPx - dividerSize) / 2),
                Rect(0, (dp.heightPx + dividerSize) / 2, dp.widthPx, dp.heightPx),
                0 /*lefTopTaskId*/, 0 /*rightBottomTaskId*/)
        mPreviewPositionHelper.setSplitBounds(splitBounds, STAGE_POSITION_TOP_OR_LEFT)

        mPreviewPositionHelper.updateThumbnailMatrix(previewRect, mThumbnailData, canvasWidth,
                canvasHeight, dp.widthPx, dp.heightPx, dp.taskbarSize, dp.isTablet, currentRotation,
                isRtl)
        params.setProgress(/* fullscreenProgress= */ 1.0f, /* parentScale= */ 1.0f,
                /* taskViewScale= */ 1.0f,  /* previewWidth= */ 0, dp, mPreviewPositionHelper)

        assertThat(params.mCurrentDrawnInsets.bottom)
                .isWithin(1f).of((0f))
    }

    @Test
    fun setFullProgress_currentDrawnInsets_clipTaskbarSizeFromBottomForTablets_splitLandscape() {
        initializeVarsForTablet(isLandscape = true)