History log of /frameworks/base/core/java/android/widget/Scroller.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/Scroller.java
54b9e5baa30a5b5f3f5dac1db877f389c250cafc 06-Aug-2014 Chet Haase <chet@google.com> Fix Scroller interpolation

The ViscousFluid interpolator simply returns the input value and not the
interpolation of that value.

Issue #16815073 Scroller.ViscousFluidInterpolator short circuited

Change-Id: Ifa189026c1396a42a2348260a2a54cf0c3caad08
/frameworks/base/core/java/android/widget/Scroller.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/Scroller.java
d75e2539c10874acd74d443f58b2e34e0c67495c 04-Sep-2013 Alan Viverette <alanv@google.com> Move viscous fluid interpolator to its own class

Change-Id: If7dcc968895ba9200b40fbc7d7aded6e6bbf6ff7
/frameworks/base/core/java/android/widget/Scroller.java
87cfad7d742c8fae1ac268168e2ada286d330ef1 07-Feb-2013 Katie McCormick <kmccormick@google.com> Doc change: Scroller Javadoc Bug # 7966653

Change-Id: I4365946f890a76fcfa78ca9d69f2a8e0848095a9
/frameworks/base/core/java/android/widget/Scroller.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/Scroller.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/Scroller.java
637d337b58d8eec6de19230a5dd5ca5581c0478d 25-Aug-2010 Adam Powell <adamp@google.com> Merge overscrolling from gingerbread.

Change-Id: I3eb4413261b38ddd8c609d6153bdfd4ae46c6a0f
/frameworks/base/core/java/android/widget/Scroller.java
04cdb78c6a2ac66505d0b29033353cfd7e2c3d78 15-Nov-2010 Gilles Debunne <debunne@google.com> New spline physics for list fling motion.

Change-Id: I72216acb29f1cd475682141701e1f2e56f52d527
/frameworks/base/core/java/android/widget/Scroller.java
d348bb4feff72d047a1037537be2d334a00c380c 15-Nov-2010 Gilles Debunne <debunne@google.com> Changes to scrolling physics

Spline curve for Scroller fling motion (debunne)

Flywheel motion for AbsListView

Change-Id: Ic1f226878745ff4c302dc6bd0752868fa182dd7b
/frameworks/base/core/java/android/widget/Scroller.java
a655c635820425a4c98314c3ba02eb382229b45d 12-Oct-2010 Romain Guy <romainguy@google.com> Actually store the newly computed deceleration.

Change-Id: Ib62470187ec7709340f04842748b9d8cb88ee0c2
/frameworks/base/core/java/android/widget/Scroller.java
4bede9e425875542976a422222510fa4056a8339 12-Oct-2010 Romain Guy <romainguy@google.com> Add an API to control AbsListView's friction.

Change-Id: Iafb08cd28703d282c369c472a5d85a22cc5dacb7
/frameworks/base/core/java/android/widget/Scroller.java
1b088be8bb304e4ab7a1896d3ec3b9df9d9cf68e 24-Jul-2010 Adam Powell <adamp@google.com> Fix a bug that could cause flings to last too long using a Scroller

Bug 2866552

Change-Id: I6979b3da54ca2aeaf4583629e28ee81fa5bd70da
/frameworks/base/core/java/android/widget/Scroller.java
b40c42f1ffa124cfbd5152007491c1d0b065592d 29-Apr-2010 Adam Powell <adamp@google.com> Fix bug 2639949 - Don't stop a Scroller early

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

Change-Id: I7e9db8d8a9b8ef67f0c0c82bf57c9155b7ebabea
/frameworks/base/core/java/android/widget/Scroller.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/Scroller.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/Scroller.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/Scroller.java
278ce05b52a47a09d2177435b533f4ecb1b9c4da 31-Aug-2009 Cary Clark <cary@android.com> accelerate consecutive flings

Use the fact that the scroller keeps track of the current velocity
to accelerate subsequent flings. The current velocity is added to
the new velocity if the flings are in the same general direction
and if the fling animation hasn't been aborted.

This makes it easier to move to the top or bottom of very large
pages (either in overview mode or reading mode) by taking
consecutive flings as a cue from the user that they want to
page faster. The user can stop the fling with any action as
before.

fixes http://b/issue?id=2066090
/frameworks/base/core/java/android/widget/Scroller.java
d663dab7dbefb49877efd2976994fb94cfa4fbd0 08-May-2009 djken <djken2009@gmail.com> The comment lack of symbol # and parameter data type. This will cause compilation failed.
/frameworks/base/core/java/android/widget/Scroller.java
c312942b773449f5c6a8a887052aec847ec73b2c 05-May-2009 Cyril Mottier <cyrilmottier@gmail.com> Add of Javadoc comments on undocumented methods.
Use of a constant defined in SensorManager for computing deceleration.
/frameworks/base/core/java/android/widget/Scroller.java
935ae463d495d41155e27feb849768ad2b8b16db 14-Apr-2009 Dianne Hackborn <> AI 145994: Integrate #145778 from Donut.

Automated import of CL 145994
/frameworks/base/core/java/android/widget/Scroller.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/widget/Scroller.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/widget/Scroller.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/android/widget/Scroller.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/widget/Scroller.java