Repository navigation
Android scroll speed deceleration rate doesn't match native #16371
Description
Activity
Have you had a chance to look at https://flutter.io/ui-performance/ ?
Not sure what you were pointing out from the video. Is it that friction is too high and the flings slow down too quickly towards the end?
@xster Yes, it is that friction is too high and the flings slow down too quickly towards the end. Comparing it with native views, there is tiny difference. I looked at the performance, it is normal.
As the difference is tiny, feel free to handle this issue. It is not blocker.Yes it does look a bit off. Would you mind comparing with our gallery app (https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)? Couldn't tell from the video but it does look a bit different from our default expected behaviour too.
- addedf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.
on Apr 11, 2018 @xster Thanks for your suggestion, I've compared with the gallery app, I think the difference is still existing. I'm comparing the scroll gallery with any android native app, the smooth is tiny different but I don't know how to figure the difference with test results, I'm just observing between them. Or else can you tell me the principle or code position of the scroll speed of Flutter?
They're different per platform but for Android, it's at https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/scroll_simulation.dart#L141 (which I believe is extracted from the Android source code). It's also all configurable via the
ScrollBehaviorwidget.Reacted by Korbin and hamber- changed the title
[-]The scroll is not as smooth as native on Android[/-][+]Android fling deceleration rate doesn't match native[/+]on Apr 11, 2018 - addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
on Jul 22, 2018 - addedplatform-androidAndroid applications specificallyAndroid applications specificallya: qualityA truly polished experienceA truly polished experiencea: fidelityMatching the OEM platforms betterMatching the OEM platforms better
on Dec 28, 2018 15 remaining items
- locked as resolved and limited conversation to collaborators
on Sep 2, 2022 - unlocked this conversation
on Sep 8, 2022 The PR that closed this is being reverted. Reopening.
For the next crack at solving this, this reproduction should be included as a test case: #110340
Also, the latest attempt included creating and passing updated FixedScrollMetrics to createBallisticScrollAnimation. This was a breaking change for customers with their own custom scroll physics that expect a scroll position be provided to createBallisticScrollAnimation, not just ScrollMetrics. Either migrating the customer off of this currently safe assumption will be required, or a different approach that preserves that.
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work listand removedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work list
on Sep 8, 2022 - added a commit that references this issue
on Feb 10, 2023 @Piinks What's the status of this issue currently? The scrolling performance I see is very similar currently. Though the device I am using is an older one so I'm not confident closing this issue based on that.
Thanks for the bump. I believe this was fixed by the combination of the two PRs
- Make ClampingScrollSimulation ballistic and more like Android #120420
- and Fix interference in fling-scrolling from cross-axis motion #122338.
These symptoms were a combined effect of
ClampingScrollSimulationhas large nonzero velocity when near the end, and velocity even increases slightly there #113424,- ClampingScrollSimulation decays sooner and goes less far than native Android scrolling #119875,
- Scroll protocol assumes ballistic scroll physics, and ClampingScrollPhysics isn't ballistic #120338,
- and Fling-scrolling is slow unless you swipe precisely vertically #120345.
Those four issues were fixed by the two PRs mentioned above. In particular, see the "after" video from the latter PR (at #122338 (comment)), which compares fling-scrolls in Flutter and a native Android scrollable.
I think that covers all the reports in this thread (other than those that were #83632). For any discrepancies that remain, it's probably best to file a new issue.
Reacted by Nabeel Parkar- addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Apr 23, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on May 7, 2023
Steps to Reproduce
1, Scroll a ListView page on Android.
2, Observe and compare the scrolls between Flutter and Native pages.
3, The scroll is tiny bumpy in Flutter. Besides, before the end of scroll, I have a feeling that it "suddenly" stops.
screenrecord_20180409_213143.mp4.zip
Flutter Doctor
[✓] Flutter (Channel beta, v0.2.3, on Mac OS X 10.12.6 16G1314, locale zh-Hans-HK)
• Flutter version 0.2.3 at /Users/guoyou/projects/flutter
• Framework revision 5a58b36 (4 weeks ago), 2018-03-13 13:20:13 -0700
• Engine revision e61bb9a
• Dart version 2.0.0-dev.35.flutter-290c576264
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/guoyou/Library/Android/sdk
• Android NDK at /Users/guoyou/Library/Android/sdk/ndk-bundle
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.4.0
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[✓] IntelliJ IDEA Community Edition (version 2017.2.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin installed
• Dart plugin version 172.3968.27
[✓] Connected devices (1 available)
• iPhone X • 8D4A21F9-E417-43CE-8B40-52CEAB6B7D04 • ios • iOS 11.2 (simulator)
• No issues found!