History log of /frameworks/base/core/java/android/widget/OverScroller.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cdac51539809beef498741570ddd4e8ade6c4b8c 07-Sep-2016 Kirill Grouchnikov <kirillg@google.com> Javadocs fixes for deprecated methods on OverScroller

Change-Id: I73aebc4727df394195d1b98e73a256d6420c3a7b
/frameworks/base/core/java/android/widget/OverScroller.java
84ad7e9ee2a2f1927fc54dcf94852a764d39bf64 04-Aug-2015 Vladislav Kaznacheev <kaznacheev@google.com> Keep OverScroller.SplineOverScroller state consistent.

Currently update() bails out early if it is called
too soon after mStartTime has been set. In this case
mCurrentPosition remains holding an obsolete value
from a previous animation. This causes some strange
behavior (see the referenced bug).

This patch makes sure that mCurrentPosition is
updated every time that mStart is updated.

Bug: 22950559
Change-Id: I07b92f30ebe29856f4e04dc19a4820123713fd7e
/frameworks/base/core/java/android/widget/OverScroller.java
160d12ee51672e1482f95a349edb49630398d335 18-Jun-2015 Vladislav Kaznacheev <kaznacheev@google.com> Fix huge bounce-back in ListView when double-flinging

The bounce-back reliably happened when AbsListView.fling
was called with high enough velocity (>50000). Such values
caused integer overflow when squared in the course of some
ballistic calculations in OverScroller.fitOnBounceCurve.

Bug: 19056278
Change-Id: I35d5376c67bc6847955b44ee268e89bce2db81d0
/frameworks/base/core/java/android/widget/OverScroller.java
987f7168d54ef42542b9d03b589f0287fd6e15c7 01-Nov-2014 Adam Powell <adamp@google.com> am d8c941ff: Merge "Don\'t update OverScroller fling state if no time has passed since start" into lmp-mr1-dev
automerge: 35261e4

* commit '35261e41b60ff2c0297dedaaff849a7414c9ff76':
Don't update OverScroller fling state if no time has passed since start
311506afbba83c11b862c1f95a24dea83fab0aad 31-Oct-2014 Adam Powell <adamp@google.com> Don't update OverScroller fling state if no time has passed since start

If no time has passed when we try to update fling state, skip the
update computation since there is nothing to do.

Fixes a bug where we could return NaN from
OverScroller#getCurrentVelocity.

Bug 17700698

Change-Id: I65042d4d26a29593f66781b58456c2d1e85381c6
/frameworks/base/core/java/android/widget/OverScroller.java
c2a0b4482d7144e8382346ea4c22c7b89368fec0 02-Oct-2014 Neil Fuller <nfuller@google.com> resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp

Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
33253a4baa6279f81a73425b49dfb6abe5f5416e 01-Oct-2014 Neil Fuller <nfuller@google.com> Switch from FloatMath -> Math and Math.hypot where possible

The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
/frameworks/base/core/java/android/widget/OverScroller.java
79a5feff954b496de5c156a2f228b9cdda43cfa8 05-Sep-2013 Alan Viverette <alanv@google.com> Fix the build, use viscous fluid interpolator in OverScroller

Change-Id: I175a220d1d915161896b9b223acfee08e0face2c
/frameworks/base/core/java/android/widget/OverScroller.java
990dfc6f908c8fc22bb15a3e0a36699e954ec28c 10-Aug-2012 Adam Powell <adamp@google.com> Sync fling physics between Scroller/OverScroller

Bug 6793537

Have the default fling physics for Scroller follow the newer patterns
from OverScroller.

Make some constants determined by DisplayMetrics density in
OverScroller per-instance rather than static.

Change-Id: I5308e4bb8eca63e95cf3f1eee1ba4fa5391023b0
/frameworks/base/core/java/android/widget/OverScroller.java
0b8acd81d5029385ec0ae3cafd90acf3036b89ac 26-Apr-2012 Adam Powell <adamp@google.com> Fix janky programmatic ListView scrolling

Adjust AbsListView to use a linear interpolator for smooth scrolling
rather than the default scroller behavior. This prevents irregular
motion as the scroll is altered in-flight to account for varying
height list items.

Bug 6397800

Change-Id: I8cc33dfc18903943369e1353930c48e2652b0142
/frameworks/base/core/java/android/widget/OverScroller.java
a181bb4b8cd5dbd3390d95fec07620c272bd350c 20-Sep-2011 Justin Ho <justinho@google.com> Tuning Overscroller's scroll curve
Softer end + rounder curve with less contrast
Bug: 5200575

Change-Id: Icff6ba3cf7ae052c80b2e80e2d2b07085fcb40ce
/frameworks/base/core/java/android/widget/OverScroller.java
b0c71eb9f50ce06327fa6bb6219f0970e04fd856 17-Sep-2011 Jeff Brown <jeffbrown@google.com> Can't stop the fling!
Bug: 5335420

Fixed a bug in VelocityTracker where the output velocity was
not being set to zero when not available.

Added a condition to ensure that the velocity is at least
the minimum fling velocity before continuing. If not, then
the user is trying to stop the fling and scroll more precisely.

Change-Id: I36634b0c3f7a9a09cf20c33f71d41163a8e33eed
/frameworks/base/core/java/android/widget/OverScroller.java
89935e41c593a599e8955388b27fb926e60e5e94 31-Aug-2011 Adam Powell <adamp@google.com> Make EdgeEffect public API.

This enables apps to make use of the system's visual edge effect used
during overscroll in 2D content.

Also un-@hide the getCurrVelocity methods from Scroller/OverScroller,
without which it becomes cumbersome to obtain values to pass to the
EdgeEffect#onAbsorb method.

Change-Id: I40e452455f5cb5d45d1fb3687f739fc8eae65560
/frameworks/base/core/java/android/widget/OverScroller.java
34961cc2e5cd483b15dfd1ff1eb33b01b849e0dc 15-Dec-2010 Gilles Debunne <debunne@google.com> Reduced Overfling threshold after many different cefficient tries.

Change-Id: Ib655e73fc75a09c6379883871fabf90793a6cff5
/frameworks/base/core/java/android/widget/OverScroller.java
086c0611d3680fbc2951f2b469bf78257ef4aed7 11-Dec-2010 Wink Saville <wink@google.com> Fix build.

This change, I80dbccebea11544595935077463ad7737c3392e9, broke the build
I undeprecated two old OverScroller constructors and hid the new one.

Change-Id: I257ebbc6bb432c6487d63ff03725146dd225a8e2
/frameworks/base/core/java/android/widget/OverScroller.java
c35a829b10946fe88b53fd3354b55218ecaff00e 10-Dec-2010 Gilles Debunne <debunne@google.com> Modified OverScroller curves

When OverFlinged, the scroller goes back to the edge using a spline
instead of a parabolic curve. This ensures that the final velocity of
this movement is null, thus removing the visual discontinuity that can
be observed with the current version.

Bouncing coefficient is deprecated. Changed doc accordingly.

New more expressive spline tension tuning coefficients.
These were tuned to match the one used before the refactoring of CL 81532.

Change-Id: I80dbccebea11544595935077463ad7737c3392e9
/frameworks/base/core/java/android/widget/OverScroller.java
fff4ab09b6c69e437537f322aaca7829f009ff1d 24-Nov-2010 Gilles Debunne <debunne@google.com> Refactored OverScroller

Restored the interpolator and a constructor with 4 parameters.

New spline coefficients, spline computation moved to MagneticOverScroller, which has been
renamed SplineOverScroller.

Change-Id: If1ab2653bb998600e9c5d6f46dfd6cd30fa44efc
/frameworks/base/core/java/android/widget/OverScroller.java
637d337b58d8eec6de19230a5dd5ca5581c0478d 25-Aug-2010 Adam Powell <adamp@google.com> Merge overscrolling from gingerbread.

Change-Id: I3eb4413261b38ddd8c609d6153bdfd4ae46c6a0f
/frameworks/base/core/java/android/widget/OverScroller.java
9d32d24dbd8a015c9d5c44ed4901d5a666eb8e7f 30-Mar-2010 Adam Powell <adamp@google.com> Remove overscrolling

Change-Id: I7e9db8d8a9b8ef67f0c0c82bf57c9155b7ebabea
/frameworks/base/core/java/android/widget/OverScroller.java
6579b0b4ac0e781efab044aaaf3f66447cf5e067 25-Mar-2010 Adam Powell <adamp@google.com> API refactoring for OverScroller.

OverScroller is no longer a child class of Scroller and several
Scroller methods that do not make sense for OverScroller and could
cause misbehaving edge cases have been removed or hidden and
deprecated.

Change-Id: Ie055b607bd3b36c47ab9798d5c9518aef686b474
/frameworks/base/core/java/android/widget/OverScroller.java
0ee0a2ea57197cb2f03905454098d9a7a309f77b 23-Mar-2010 Gilles Debunne <debunne@google.com> New edge effect when OverScrolled.

The constant force that was applied has been replaced by a spring force
when the OverScroller goes beyond valid position values.

Bounce coefficient can be set for each directions.

Change-Id: If7d506d3f35b3451f590c54d6c04a1deb8d9ca95
/frameworks/base/core/java/android/widget/OverScroller.java
52964243dc95f74ac2ab9a96d031a36931a11931 24-Feb-2010 Gilles Debunne <debunne@google.com> New OverScroller with edge bouncing effect.

OverScroller has been made a Scroller child class. Both use a physical constant deceleration
force to compute the animation. OverScroller also includes a rubber edge bounce effect.

Approved by Jim Palmer.

Change-Id: I3f43a03694b8cb6bfa0784c2663b37c9c39322cc
/frameworks/base/core/java/android/widget/OverScroller.java
d93b998c92ce192ea4b99cdf0cecd74df742fbef 03-Mar-2010 Adam Powell <adamp@google.com> Fix a bug in OverScroller.setFinalX/Y
/frameworks/base/core/java/android/widget/OverScroller.java
9d5b488abeb6acbf5135340d016994af97baeff9 03-Mar-2010 Adam Powell <adamp@google.com> Added Scroller compatibility methods to OverScroller
/frameworks/base/core/java/android/widget/OverScroller.java
eb6b1fa7b86e529ed7de1c77fbc77ccef65bf6a9 03-Feb-2010 Adam Powell <adamp@google.com> Fixed an overscrolling bug in AbsListView with a root in OverScroller.
/frameworks/base/core/java/android/widget/OverScroller.java
79ac3395b58de5b99f0bb43d8950f6b95348326d 29-Jan-2010 Adam Powell <adamp@google.com> Overscrolling in AbsListView; visibility cleanup for FlingRunnable
/frameworks/base/core/java/android/widget/OverScroller.java
3fc3737ceb0f5c3b086472fb2cf7ebfb089e1bc8 28-Jan-2010 Adam Powell <adamp@google.com> ScrollView and HorizontalScrollView now will spring back if smoothScrollBy scrolls out of bounds. Tweaked bounce physics for OverScroller.
/frameworks/base/core/java/android/widget/OverScroller.java
17dfce15d5c3e7eae7a3c129019f48e7c5f65063 26-Jan-2010 Adam Powell <adamp@google.com> Added OverScroller and overscroll effects for ScrollView and HorizontalScrollView.
/frameworks/base/core/java/android/widget/OverScroller.java