00a4ea970bab16ef5675e866cd856a0d9919f0c5 |
|
08-Jun-2017 |
Siarhei Vishniakou <svv@google.com> |
New impulse-based VelocityTracker strategy. New velocity calculation strategy for VelocityTracker. The strategy models the phone screen as a physical object that gets pushed by the finger. Upon liftoff, the total work done on the object (past 100ms of data and at most 20 most recent samples) is considered to be kinetic energy, which gets converted into equivalent velocity. Works well with "bad" data - unclean touch liftoff, repeated coordinates. Time-shift invariant. Performance otherwise similar to the current default strategy, quadratic unweighted least squares. Bug: 35412046 Test: Recorded bad scroll event on swordfish, this fixes the fling in the wrong direction. Also tested common usecase scenarios on sailfish, no regressions observed. Similar velocity values to lsq2 strategy. Change-Id: Ib439db0ce3b4fe84f59cf66683eae0b5df7776eb
/frameworks/native/include/input/VelocityTracker.h
|