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

Commit 9a33e9a7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9358956 from 12053e95 to tm-qpr2-release

Change-Id: I5a14eed86c8d3a8490c219db3163aa4b0f8477bf
parents 3bafdba7 12053e95
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1204,7 +1204,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        final GestureEndTarget endTarget = calculateEndTarget(velocity, endVelocity,
                isFling, isCancel);

        setClampScrollOffset(false);
        // Set the state, but don't notify until the animation completes
        mGestureState.setEndTarget(endTarget, false /* isAtomic */);
        mAnimationFactory.setEndTarget(endTarget);
@@ -1282,13 +1281,16 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

        // Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
        // or resumeLastTask().
        Runnable onPageTransitionEnd = () -> {
            mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
            setClampScrollOffset(false);
        };
        if (mRecentsView != null) {
            ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
                    .SET_ON_PAGE_TRANSITION_END_CALLBACK);
            mRecentsView.setOnPageTransitionEndCallback(
                    () -> mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED));
            mRecentsView.setOnPageTransitionEndCallback(onPageTransitionEnd);
        } else {
            mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
            onPageTransitionEnd.run();
        }

        animateToProgress(startShift, endShift, duration, interpolator, endTarget, velocity);
+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,
+5 −5
Original line number Diff line number Diff line
@@ -5072,15 +5072,15 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
     * Returns how many pixels the page is offset on the currently laid out dominant axis.
     */
    public int getScrollOffset(int pageIndex) {
        int unboundedOffset = getUnclampedScrollOffset(pageIndex);
        int unclampedOffset = getUnclampedScrollOffset(pageIndex);
        if (!mShouldClampScrollOffset) {
            return unboundedOffset;
            return unclampedOffset;
        }
        if (Math.abs(unboundedOffset) < mClampedScrollOffsetBound) {
        if (Math.abs(unclampedOffset) < mClampedScrollOffsetBound) {
            return 0;
        }
        return unboundedOffset
                - Math.round(Math.signum(unboundedOffset) * mClampedScrollOffsetBound);
        return unclampedOffset
                - Math.round(Math.signum(unclampedOffset) * mClampedScrollOffsetBound);
    }

    /**
+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)
Loading