Obsolete
Status Update
Comments
le...@google.com <le...@google.com>
wb...@gmail.com <wb...@gmail.com> #2
Any idea on how I can further debug this issue? Thanks
le...@google.com <le...@google.com> #3
Hi, sorry for the late response, not updates yet. There has been some updates to VelocityTrackerAddPointsFix you might want to try, but it looks like the slow device may be sending data too slowly to the tracker, AssumePointerMoveStoppedMilliseconds is 40ms because that's how the platform tracker works and the compose tracker uses a similar implementation. Let us know if the issue was fixed with the latest changes in VelocityTrackerAddPointsFix.
Thanks!
le...@google.com <le...@google.com> #4
The fix from VelocityTrackerAddPointsFix will become available in the next stable release (1.7) it should fix this issue.
Description
Jetpack Compose version: 1.4.3
Jetpack Compose component(s) used: scrollable LazyVerticalGrid
Android Studio Build: Android Studio Flamingo
Kotlin version: 1.8.21
Steps to Reproduce or Code Sample to Reproduce:
I tried Compose 1.6alpha01 on an Android 7.1.1 device with the VelocityTrackerAddPointsFix set to true. On that device there is still no Fling present.
Logging from a working device:
The logs from the Android 7.1.x device:
After debugging more in the Jetpack Compose I have found the following in androidx.compose.ui.input.pointer.util.VelocityTracker:
and in the function calculateVelocity():
At least on the slower Android 7.1.1 device (with a debug build) the delta is larger then 40, causing the calculateVelocity returning 0 afterwards because the sampleCount was only 1 (less then the minSampleSize of 3). When the Velocity is zero, eventually onPreFling will be called with that velocity.
VelocityTracker.samples contain:
The index of the loop is 11 at the time of executing the above break statement. What I find strange is that there are some duplicate data points with a different time
Any ideas on how to fix this and why AssumePointerMoveStoppedMilliseconds is 40ms would be appreciated.