Compose UI should match Android's native fling scrolling behavior, delegating to the platform for forward compatibility where possible.
Android's scrolling components, android.widget.Scroller and android.widget.OverScroller internally use the static clock provided by AnimationUtils, making it infeasible to use these components natively in Compose UI without changes.
This work will proceed in several steps:
Extract the sampled spline used by Scroller such that it can be used in a testable, clock-agnostic manner.
Implement a Compose UI DecayAnimation based on this extracted spline.
Make (2) the default behavior of VerticalScroller and similar rather than the exponential decay animation.
Apply the changes from (1) back to AOSP frameworks/base
Refactor (1) to use (4) when running on a new enough Android platform version for forward compatibility with any future Android platform changes
Description
Compose UI should match Android's native fling scrolling behavior, delegating to the platform for forward compatibility where possible.
Android's scrolling components,
android.widget.Scroller
andandroid.widget.OverScroller
internally use the static clock provided byAnimationUtils
, making it infeasible to use these components natively in Compose UI without changes.This work will proceed in several steps:
Scroller
such that it can be used in a testable, clock-agnostic manner.DecayAnimation
based on this extracted spline.VerticalScroller
and similar rather than the exponential decay animation.frameworks/base