Merge "Fixed EdgeEffect drawn on non-RecordingCanvas" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
caab1b26a3
@@ -640,6 +640,12 @@ public class EdgeEffect {
|
||||
mWidth,
|
||||
mHeight
|
||||
);
|
||||
} else {
|
||||
// This is TYPE_STRETCH and drawing into a Canvas that isn't a Recording Canvas,
|
||||
// so no effect can be shown. Just end the effect.
|
||||
mState = STATE_IDLE;
|
||||
mDistance = 0;
|
||||
mVelocity = 0;
|
||||
}
|
||||
|
||||
boolean oneLastFrame = false;
|
||||
@@ -771,8 +777,9 @@ public class EdgeEffect {
|
||||
* considered at rest or false if it is still animating.
|
||||
*/
|
||||
private boolean isAtEquilibrium() {
|
||||
double displacement = mDistance * mHeight; // in pixels
|
||||
return Math.abs(mVelocity) < VELOCITY_THRESHOLD
|
||||
double displacement = mDistance * mHeight * LINEAR_STRETCH_INTENSITY; // in pixels
|
||||
double velocity = mVelocity * LINEAR_STRETCH_INTENSITY;
|
||||
return Math.abs(velocity) < VELOCITY_THRESHOLD
|
||||
&& Math.abs(displacement) < VALUE_THRESHOLD;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user