Merge "Update for stashed taskbar animation" into tm-qpr-dev

This commit is contained in:
Vinit Nayak
2022-12-01 19:26:11 +00:00
committed by Android (Google) Code Review
3 changed files with 31 additions and 1 deletions

View File

@@ -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,

View File

@@ -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);

View File

@@ -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)