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:
Tony Wickham
2018-04-16 14:08:57 -07:00
parent 229fc93949
commit 78595cd7de
5 changed files with 78 additions and 32 deletions
@@ -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;
}