Compute window offset when quick scrub starts
Instead of setting the window center to match the task center on every update, compute the final offset when quick scrub starts and interpolate alongside other factors such as window scale. Bug: 78027888 Change-Id: I33b115764d46ecd6907ecb82b1ba12aeefc583c5
This commit is contained in:
@@ -219,11 +219,20 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
|
||||
mSnapshotView.setDimAlpha(mCurveDimAlpha);
|
||||
}
|
||||
|
||||
mCurveScale = 1 - curveInterpolation * EDGE_SCALE_DOWN_FACTOR;
|
||||
mCurveScale = getCurveScaleForCurveInterpolation(curveInterpolation);
|
||||
setScaleX(mCurveScale);
|
||||
setScaleY(mCurveScale);
|
||||
}
|
||||
|
||||
public float getCurveScaleForInterpolation(float linearInterpolation) {
|
||||
float curveInterpolation = CURVE_INTERPOLATOR.getInterpolation(linearInterpolation);
|
||||
return getCurveScaleForCurveInterpolation(curveInterpolation);
|
||||
}
|
||||
|
||||
private float getCurveScaleForCurveInterpolation(float curveInterpolation) {
|
||||
return 1 - curveInterpolation * EDGE_SCALE_DOWN_FACTOR;
|
||||
}
|
||||
|
||||
public float getCurveScale() {
|
||||
return mCurveScale;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user