Remove scaling and dimming for adjacent tasks in Overview.

New designs flatten out the overview list and don't have scaled and dimmed
tasks adjacent to the main one.

Bug: 179922117
Test: Local run
Change-Id: I2dde04ed60b9d8459810a10d0c27dd6e131855a6
This commit is contained in:
Zak Cohen committed 2021-02-11 19:21:27 +00:00
1 parent fa58bfa0b7
commit b849aaf63d
3 files changed
+5 -52

No files matched your search

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