Merge "Remove scaling and dimming for adjacent tasks in Overview." into sc-dev

This commit is contained in:
Zak Cohen 2021-02-13 01:22:51 +00:00 committed by Android (Google) Code Review
commit e38dc9b5f8
3 changed files with 5 additions and 52 deletions

View File

@ -41,7 +41,6 @@ import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.BaseActivityInterface;
import com.android.quickstep.views.RecentsView.ScrollState;
import com.android.quickstep.views.TaskThumbnailView.PreviewPositionHelper;
import com.android.quickstep.views.TaskView;
import com.android.quickstep.views.TaskView.FullscreenDrawParams;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@ -92,7 +91,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
// TaskView properties
private final FullscreenDrawParams mCurrentFullscreenParams;
private float mCurveScale = 1;
public final AnimatedFloat taskPrimaryTranslation = new AnimatedFloat();
public final AnimatedFloat taskSecondaryTranslation = new AnimatedFloat();
@ -277,8 +275,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
.getPrimaryValue(mTaskRect.left, mTaskRect.top);
mScrollState.screenCenter = start + mScrollState.scroll + mScrollState.halfPageSize;
mScrollState.updateInterpolation(mDp, start);
mCurveScale = TaskView.getCurveScaleForInterpolation(mDp,
mScrollState.linearInterpolation);
}
float progress = Utilities.boundToRange(fullScreenProgress.value, 0, 1);
@ -295,8 +291,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
mMatrix.postTranslate(insets.left, insets.top);
mMatrix.postScale(scale, scale);
// Apply TaskView matrix: scale, translate, scroll
mMatrix.postScale(mCurveScale, mCurveScale, taskWidth / 2, taskHeight / 2);
// Apply TaskView matrix: translate, scroll
mMatrix.postTranslate(mTaskRect.left, mTaskRect.top);
mOrientationState.getOrientationHandler().set(mMatrix, MATRIX_POST_TRANSLATE,
taskPrimaryTranslation.value);

View File

@ -1984,11 +1984,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
centerToOffscreenProgress = Utilities.mapRange(centerToOffscreenProgress,
distanceFromMidpoint / distanceToOffscreen, 1);
}
// Find the task's scale based on its offscreen progress, then see how far it still needs to
// move to be completely offscreen.
Utilities.scaleRectFAboutCenter(taskPosition,
TaskView.getCurveScaleForInterpolation(mActivity.getDeviceProfile(),
centerToOffscreenProgress));
distanceToOffscreen = desiredLeft - taskPosition.left;
// Finally, we need to account for RecentsView scale, because it moves tasks based on its
// pivot. To do this, we move the task position to where it would be offscreen at scale = 1
@ -2114,7 +2109,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
anim.play(ObjectAnimator.ofFloat(recentsView, FULLSCREEN_PROGRESS, 1));
} else {
// We are launching an adjacent task, so parallax the center and other adjacent task.
float displacementX = tv.getWidth() * (toScale - tv.getCurveScale());
float displacementX = tv.getWidth() * (toScale - 1f);
float primaryTranslation = mIsRtl ? -displacementX : displacementX;
anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex),
mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation));

View File

@ -44,7 +44,6 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
@ -112,10 +111,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
private static final String TAG = TaskView.class.getSimpleName();
/** A curve of x from 0 to 1, where 0 is the center of the screen and 1 is the edge. */
private static final TimeInterpolator CURVE_INTERPOLATOR
= x -> (float) -Math.cos(x * Math.PI) / 2f + .5f;
/**
* The alpha of a black scrim on a page in the carousel as it leaves the screen.
* In the resting position of the carousel, the adjacent pages have about half this scrim.
@ -252,7 +247,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
private TaskMenuView mMenuView;
private IconView mIconView;
private final DigitalWellBeingToast mDigitalWellBeingToast;
private float mCurveScale;
private float mFullscreenProgress;
private float mScaleAtFullscreen = 1;
private float mFullscreenScale = 1;
@ -655,7 +649,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
progress = 1 - progress;
}
mFocusTransitionProgress = progress;
mSnapshotView.setDimAlphaMultipler(progress);
mSnapshotView.setDimAlphaMultipler(0);
float iconScalePercentage = (float) SCALE_ICON_DURATION / DIM_ANIM_DURATION;
float lowerClamp = invert ? 1f - iconScalePercentage : 0;
float upperClamp = invert ? 1 : iconScalePercentage;
@ -703,7 +697,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
}
protected void resetViewTransforms() {
setCurveScale(1);
// fullscreenTranslation and accumulatedTranslation should not be reset, as
// resetViewTransforms is called during Quickswitch scrolling.
mDismissTranslationX = mTaskOffsetTranslationX = mTaskResistanceTranslationX = 0f;
@ -738,13 +731,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
return;
}
float curveInterpolation =
CURVE_INTERPOLATOR.getInterpolation(scrollState.linearInterpolation);
float curveScaleForCurveInterpolation = getCurveScaleForCurveInterpolation(
mActivity.getDeviceProfile(), curveInterpolation);
mSnapshotView.setDimAlpha(curveInterpolation * MAX_PAGE_SCRIM_ALPHA);
setCurveScale(curveScaleForCurveInterpolation);
float dwbBannerAlpha = Utilities.boundToRange(1.0f - 2 * scrollState.linearInterpolation,
0f, 1f);
mDigitalWellBeingToast.updateBannerAlpha(dwbBannerAlpha);
@ -825,20 +811,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
}
}
/**
* How much to scale down pages near the edge of the screen according to linearInterpolation.
*/
public static float getCurveScaleForInterpolation(DeviceProfile deviceProfile,
float linearInterpolation) {
float curveInterpolation = CURVE_INTERPOLATOR.getInterpolation(linearInterpolation);
return getCurveScaleForCurveInterpolation(deviceProfile, curveInterpolation);
}
private static float getCurveScaleForCurveInterpolation(DeviceProfile deviceProfile,
float curveInterpolation) {
return 1 - curveInterpolation * getEdgeScaleDownFactor(deviceProfile);
}
/**
* How much to scale down pages near the edge of the screen.
*/
@ -850,23 +822,14 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
}
}
private void setCurveScale(float curveScale) {
mCurveScale = curveScale;
applyScale();
}
private void setFullscreenScale(float fullscreenScale) {
mFullscreenScale = fullscreenScale;
applyScale();
}
private void applyScale() {
setScaleX(mCurveScale * mFullscreenScale);
setScaleY(mCurveScale * mFullscreenScale);
}
public float getCurveScale() {
return mCurveScale;
setScaleX(mFullscreenScale);
setScaleY(mFullscreenScale);
}
private void setDismissTranslationX(float x) {