Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable overscroll effect on Android when reduce animations setting is enabled #839

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

hjiangsu
Copy link
Member

@hjiangsu hjiangsu commented Oct 19, 2023

Pull Request Description

This PR disables overscroll effects on Android whenever the reduce animation setting is on. Previously, we used to set the physics for scrollable lists to use BouncingScrollPhysics to match what happens on iOS. However, as mentioned in #758, that was not an optimal solution to this issue.

As such, I've figured out an alternate method of completely disabling overscroll effects by overriding the default scrollBehaviour when the app initializes.

Note that I had to add in reduceAnimations to ThemeState as main.dart does not have access to ThunderBloc. This does duplicate the code a bit since this setting is also present in ThunderState. To clean this up, we can remove reduceAnimations in ThunderState and only use the value present in ThemeState (I'll leave this as a TODO for the future PR)

@micahmo I've tested this on an emulator, but do try it out on a physical device and see if it works appropriately!

Issue Being Fixed

Issue Number: #758

Screenshots / Recordings

overscroll.webm

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfect on a physical device!!

Note that I had to add in reduceAnimations to ThemeState as main.dart does not have access to ThunderBloc.

FWIW, @ggichure proposed moving ThunderBloc to main.dart in #832. If you go with that approach, that would solve this issue too.

@hjiangsu
Copy link
Member Author

FWIW, @ggichure proposed moving ThunderBloc to main.dart in #832. If you go with that approach, that would solve this issue too.

That could also be a possibility!

@hjiangsu hjiangsu merged commit a9e1505 into develop Oct 19, 2023
1 check passed
@hjiangsu hjiangsu deleted the feature/disable-overscroll-effects branch October 19, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants