From e4f9d4f632d5c3599930685a5d33f446a82f5f3a Mon Sep 17 00:00:00 2001 From: George Mount Date: Thu, 22 Apr 2021 16:20:25 +0000 Subject: [PATCH] Reduce animation completion epsilon to avoid early end. Fixes: 184892316 Changed the animation termination epsilons to make sure that the animation doesn't end early and cause a jerky end. Test: visual inspection Change-Id: I56e4ccb50cee95e713e92ffb659eff4dd026dd12 --- core/java/android/widget/EdgeEffect.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java index 95a3dc788803c..4d2d9e86f1a68 100644 --- a/core/java/android/widget/EdgeEffect.java +++ b/core/java/android/widget/EdgeEffect.java @@ -106,13 +106,13 @@ public class EdgeEffect { * The velocity threshold before the spring animation is considered settled. * The idea here is that velocity should be less than 0.1 pixel per second. */ - private static final double VELOCITY_THRESHOLD = 0.1; + private static final double VELOCITY_THRESHOLD = 0.01; /** * The value threshold before the spring animation is considered close enough to * the destination to be settled. This should be around 0.01 pixel. */ - private static final double VALUE_THRESHOLD = 0.01; + private static final double VALUE_THRESHOLD = 0.001; /** * The natural frequency of the stretch spring.