Update scrolling logic in Android horizontal tab switcher
The Android horizontal tab switcher currently feels very "slippery." This is largely because we currently have a bug in the logic that gives flings a "boost" to the next tab where, if you start dragging a tab over so that it's already the centered tab, we apply the boost anyway, so you actually end up scrolling by two tabs. The minimum scroll distance to move over by one tab is also currently fairly large, which makes it easier to run into the bugging fling boost behavior. This CL fixes these two issues. I'm also introducing some non-linearity into the scroll distance function. After this CL, the velocity range to scroll by one tab is fairly large, then the velocity range to scroll by two tabs is somewhat smaller, and then the ranges to scroll by 3 through 11 tabs are fairly small, and then the range to scroll by 12 tabs is fairly large again. Bug: 849417 Change-Id: I9f3d442a191091a126410526c9097c445eb9fe40 Reviewed-on: https://chromium-review.googlesource.com/1109212 Commit-Queue: Ryan Landay <rlanday@chromium.org> Reviewed-by:Matthew Jones <mdjones@chromium.org> Cr-Commit-Position: refs/heads/master@{#570102}
Showing
Please register or sign in to comment