Loading quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +1 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { boolean isRtlEnabled = !mIsRecentsRtl; mPositionHelper.updateThumbnailMatrix( mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(), mDp.widthPx, mDp.taskbarSize, mDp.isTablet, mDp.widthPx, mDp.heightPx, mDp.taskbarSize, mDp.isTablet, mOrientationState.getRecentsActivityRotation(), isRtlEnabled); mPositionHelper.getMatrix().invert(mInversePositionMatrix); if (DEBUG) { Loading quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +2 −2 Original line number Diff line number Diff line Loading @@ -473,8 +473,8 @@ public class TaskThumbnailView extends View { boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; DeviceProfile dp = mActivity.getDeviceProfile(); mPreviewPositionHelper.updateThumbnailMatrix(mPreviewRect, mThumbnailData, getMeasuredWidth(), getMeasuredHeight(), dp.widthPx, dp.taskbarSize, dp.isTablet, currentRotation, isRtl); getMeasuredWidth(), getMeasuredHeight(), dp.widthPx, dp.heightPx, dp.taskbarSize, dp.isTablet, currentRotation, isRtl); mBitmapShader.setLocalMatrix(mPreviewPositionHelper.getMatrix()); mPaint.setShader(mBitmapShader); Loading quickstep/tests/src/com/android/quickstep/FullscreenDrawParamsTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class FullscreenDrawParamsTest : DeviceProfileBaseTest() { val isRtl = false mPreviewPositionHelper.updateThumbnailMatrix(previewRect, mThumbnailData, canvasWidth, canvasHeight, dp.widthPx, dp.taskbarSize, dp.isTablet, currentRotation, 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) Loading @@ -78,7 +78,7 @@ class FullscreenDrawParamsTest : DeviceProfileBaseTest() { val isRtl = false mPreviewPositionHelper.updateThumbnailMatrix(previewRect, mThumbnailData, canvasWidth, canvasHeight, dp.widthPx, dp.taskbarSize, dp.isTablet, currentRotation, 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) Loading src/com/android/launcher3/touch/PortraitPagedViewHandler.java +23 −12 Original line number Diff line number Diff line Loading @@ -585,7 +585,6 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { @Override public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect, SplitBounds splitInfo, int desiredStagePosition) { boolean isLandscape = dp.isLandscape; float topLeftTaskPercent = splitInfo.appsStackedVertically ? splitInfo.topTaskPercent : splitInfo.leftTaskPercent; Loading @@ -593,18 +592,24 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { ? splitInfo.dividerHeightPercent : splitInfo.dividerWidthPercent; int deviceHeightWithoutTaskbar = dp.availableHeightPx - dp.taskbarSize; float scale = (float) outRect.height() / deviceHeightWithoutTaskbar; float topTaskHeight = dp.availableHeightPx * topLeftTaskPercent; float scaledTopTaskHeight = topTaskHeight * scale; float dividerHeight = dp.availableHeightPx * dividerBarPercent; float scaledDividerHeight = dividerHeight * scale; if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) { if (isLandscape) { outRect.right = outRect.left + Math.round(outRect.width() * topLeftTaskPercent); if (splitInfo.appsStackedVertically) { outRect.bottom = Math.round(outRect.top + scaledTopTaskHeight); } else { outRect.bottom = outRect.top + Math.round(outRect.height() * topLeftTaskPercent); outRect.right = outRect.left + Math.round(outRect.width() * topLeftTaskPercent); } } else { if (isLandscape) { outRect.left += Math.round(outRect.width() * (topLeftTaskPercent + dividerBarPercent)); if (splitInfo.appsStackedVertically) { outRect.top += Math.round(scaledTopTaskHeight + scaledDividerHeight); } else { outRect.top += Math.round(outRect.height() outRect.left += Math.round(outRect.width() * (topLeftTaskPercent + dividerBarPercent)); } } Loading @@ -617,7 +622,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx; int totalThumbnailHeight = parentHeight - spaceAboveSnapshot; int dividerBar = Math.round(splitBoundsConfig.appsStackedVertically ? splitBoundsConfig.dividerHeightPercent * totalThumbnailHeight ? splitBoundsConfig.dividerHeightPercent * dp.availableHeightPx : splitBoundsConfig.dividerWidthPercent * parentWidth); int primarySnapshotHeight; int primarySnapshotWidth; Loading @@ -641,12 +646,18 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { } secondarySnapshot.setTranslationY(spaceAboveSnapshot); } else { int deviceHeightWithoutTaskbar = dp.availableHeightPx - dp.taskbarSize; float scale = (float) totalThumbnailHeight / deviceHeightWithoutTaskbar; float topTaskHeight = dp.availableHeightPx * taskPercent; float finalDividerHeight = dividerBar * scale; float scaledTopTaskHeight = topTaskHeight * scale; primarySnapshotWidth = parentWidth; primarySnapshotHeight = Math.round(totalThumbnailHeight * taskPercent); primarySnapshotHeight = Math.round(scaledTopTaskHeight); secondarySnapshotWidth = parentWidth; secondarySnapshotHeight = totalThumbnailHeight - primarySnapshotHeight - dividerBar; int translationY = primarySnapshotHeight + spaceAboveSnapshot + dividerBar; secondarySnapshotHeight = Math.round(totalThumbnailHeight - primarySnapshotHeight - finalDividerHeight); float translationY = primarySnapshotHeight + spaceAboveSnapshot + finalDividerHeight; secondarySnapshot.setTranslationY(translationY); FrameLayout.LayoutParams primaryParams = Loading Loading
quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +1 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { boolean isRtlEnabled = !mIsRecentsRtl; mPositionHelper.updateThumbnailMatrix( mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(), mDp.widthPx, mDp.taskbarSize, mDp.isTablet, mDp.widthPx, mDp.heightPx, mDp.taskbarSize, mDp.isTablet, mOrientationState.getRecentsActivityRotation(), isRtlEnabled); mPositionHelper.getMatrix().invert(mInversePositionMatrix); if (DEBUG) { Loading
quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +2 −2 Original line number Diff line number Diff line Loading @@ -473,8 +473,8 @@ public class TaskThumbnailView extends View { boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; DeviceProfile dp = mActivity.getDeviceProfile(); mPreviewPositionHelper.updateThumbnailMatrix(mPreviewRect, mThumbnailData, getMeasuredWidth(), getMeasuredHeight(), dp.widthPx, dp.taskbarSize, dp.isTablet, currentRotation, isRtl); getMeasuredWidth(), getMeasuredHeight(), dp.widthPx, dp.heightPx, dp.taskbarSize, dp.isTablet, currentRotation, isRtl); mBitmapShader.setLocalMatrix(mPreviewPositionHelper.getMatrix()); mPaint.setShader(mBitmapShader); Loading
quickstep/tests/src/com/android/quickstep/FullscreenDrawParamsTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class FullscreenDrawParamsTest : DeviceProfileBaseTest() { val isRtl = false mPreviewPositionHelper.updateThumbnailMatrix(previewRect, mThumbnailData, canvasWidth, canvasHeight, dp.widthPx, dp.taskbarSize, dp.isTablet, currentRotation, 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) Loading @@ -78,7 +78,7 @@ class FullscreenDrawParamsTest : DeviceProfileBaseTest() { val isRtl = false mPreviewPositionHelper.updateThumbnailMatrix(previewRect, mThumbnailData, canvasWidth, canvasHeight, dp.widthPx, dp.taskbarSize, dp.isTablet, currentRotation, 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) Loading
src/com/android/launcher3/touch/PortraitPagedViewHandler.java +23 −12 Original line number Diff line number Diff line Loading @@ -585,7 +585,6 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { @Override public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect, SplitBounds splitInfo, int desiredStagePosition) { boolean isLandscape = dp.isLandscape; float topLeftTaskPercent = splitInfo.appsStackedVertically ? splitInfo.topTaskPercent : splitInfo.leftTaskPercent; Loading @@ -593,18 +592,24 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { ? splitInfo.dividerHeightPercent : splitInfo.dividerWidthPercent; int deviceHeightWithoutTaskbar = dp.availableHeightPx - dp.taskbarSize; float scale = (float) outRect.height() / deviceHeightWithoutTaskbar; float topTaskHeight = dp.availableHeightPx * topLeftTaskPercent; float scaledTopTaskHeight = topTaskHeight * scale; float dividerHeight = dp.availableHeightPx * dividerBarPercent; float scaledDividerHeight = dividerHeight * scale; if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) { if (isLandscape) { outRect.right = outRect.left + Math.round(outRect.width() * topLeftTaskPercent); if (splitInfo.appsStackedVertically) { outRect.bottom = Math.round(outRect.top + scaledTopTaskHeight); } else { outRect.bottom = outRect.top + Math.round(outRect.height() * topLeftTaskPercent); outRect.right = outRect.left + Math.round(outRect.width() * topLeftTaskPercent); } } else { if (isLandscape) { outRect.left += Math.round(outRect.width() * (topLeftTaskPercent + dividerBarPercent)); if (splitInfo.appsStackedVertically) { outRect.top += Math.round(scaledTopTaskHeight + scaledDividerHeight); } else { outRect.top += Math.round(outRect.height() outRect.left += Math.round(outRect.width() * (topLeftTaskPercent + dividerBarPercent)); } } Loading @@ -617,7 +622,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx; int totalThumbnailHeight = parentHeight - spaceAboveSnapshot; int dividerBar = Math.round(splitBoundsConfig.appsStackedVertically ? splitBoundsConfig.dividerHeightPercent * totalThumbnailHeight ? splitBoundsConfig.dividerHeightPercent * dp.availableHeightPx : splitBoundsConfig.dividerWidthPercent * parentWidth); int primarySnapshotHeight; int primarySnapshotWidth; Loading @@ -641,12 +646,18 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { } secondarySnapshot.setTranslationY(spaceAboveSnapshot); } else { int deviceHeightWithoutTaskbar = dp.availableHeightPx - dp.taskbarSize; float scale = (float) totalThumbnailHeight / deviceHeightWithoutTaskbar; float topTaskHeight = dp.availableHeightPx * taskPercent; float finalDividerHeight = dividerBar * scale; float scaledTopTaskHeight = topTaskHeight * scale; primarySnapshotWidth = parentWidth; primarySnapshotHeight = Math.round(totalThumbnailHeight * taskPercent); primarySnapshotHeight = Math.round(scaledTopTaskHeight); secondarySnapshotWidth = parentWidth; secondarySnapshotHeight = totalThumbnailHeight - primarySnapshotHeight - dividerBar; int translationY = primarySnapshotHeight + spaceAboveSnapshot + dividerBar; secondarySnapshotHeight = Math.round(totalThumbnailHeight - primarySnapshotHeight - finalDividerHeight); float translationY = primarySnapshotHeight + spaceAboveSnapshot + finalDividerHeight; secondarySnapshot.setTranslationY(translationY); FrameLayout.LayoutParams primaryParams = Loading