Skip to content

Android scroll speed deceleration rate doesn't match native #16371

Description

@korbin-w

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!

Activity

  1. Hixie commented on Apr 10, 2018

    @Hixie
    Contributor

    Have you had a chance to look at https://flutter.io/ui-performance/ ?

  2. xster commented on Apr 10, 2018

    @xster
    Member

    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?

  3. korbin-w commented on Apr 11, 2018

    @korbin-w
    Author

    @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.

  4. xster commented on Apr 11, 2018

    @xster
    Member

    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.

  5. korbin-w commented on Apr 11, 2018

    @korbin-w
    Author

    @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?

  6. xster commented on Apr 11, 2018

    @xster
    Member

    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 ScrollBehavior widget.

  7. 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
  8. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jul 22, 2018
  9. 15 remaining items

  10. locked as resolved and limited conversation to collaborators on Sep 2, 2022
  11. unlocked this conversation on Sep 8, 2022
  12. Piinks commented on Sep 8, 2022

    @Piinks
    Contributor

    The PR that closed this is being reverted. Reopening.

  13. reopened this on Sep 8, 2022
  14. Piinks commented on Sep 8, 2022

    @Piinks
    Contributor

    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.

  15. removed their assignment
    on Sep 8, 2022
  16. added
    P2Important issues not at the top of the work list
    and removed
    P1High-priority issues at the top of the work list
    on Sep 8, 2022
  17. exaby73 commented on Apr 21, 2023

    @exaby73
    Member

    @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.

  18. gnprice commented on Apr 21, 2023

    @gnprice
    Member

    Thanks for the bump. I believe this was fixed by the combination of the two PRs

    These symptoms were a combined effect of

    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.

  19. added
    r: fixedIssue is closed as already fixed in a newer version
    on Apr 23, 2023
  20. github-actions commented on May 7, 2023

    @github-actions

    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 -v and a minimal reproduction of the issue.

  21. locked as resolved and limited conversation to collaborators on May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: qualityA truly polished experiencecustomer: alibabaf: scrollingViewports, list views, slivers, etc.found in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions