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

Snap to next does not animate on Android #721

Open
5 tasks done
bitttttten opened this issue Jul 3, 2020 · 6 comments
Open
5 tasks done

Snap to next does not animate on Android #721

bitttttten opened this issue Jul 3, 2020 · 6 comments

Comments

@bitttttten
Copy link

Is this a bug report, a feature request, or a question?

Bug report.

Have you followed the required steps before opening a bug report?

(Check the step you've followed - put an x character between the square brackets ([]).)

Have you made sure that it wasn't a React Native bug?

Yes

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

Android

Is the bug reproductible in a production environment (not a debug one)?

Yes.

Environment

info Fetching system and libraries information...
System:
    OS: macOS 10.15.5
    CPU: (16) x64 AMD Ryzen 7 1700X Eight-Core Processor         
    Memory: 166.43 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v12.18.0/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  npmPackages:
    react: 16.13.1 => 16.13.1 
    react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4

Expected Behavior

When calling carouselRef.current.snapToItem(lastItemIndex) the carousel will animate to the position.

Actual Behavior

When calling carouselRef.current.snapToItem(lastItemIndex) the carousel does not animate to the position, it just snaps there. On iOS it does animate.

@ajacquierbret
Copy link

Hi @bitttttten ! A lot of issues have been reported concerning Android with v3 and a lot of these issues have been solved by v4-beta, which is a complete refactoring of what we could call a "pile of hacks", so I can't suggest you more to try it out ! You'll certainly be amazed to see how your carousel will behave after an upgrade ! :)

Debugging Android related issues about this lib is always really hard because of some persistent annoying native bugs, and I think you can't go for a better choice than to switch to the earliest beta version.

@bitttttten
Copy link
Author

Ah okay, I'll try the v4 beta then. Thanks for the tip!

@bitttttten
Copy link
Author

It animates on the v4 beta! Although I ran into a few regressions so I can't move over to v4 beta until those are resolved. But thanks again for the tip :)

@ajacquierbret
Copy link

I'm glad it helped ! I made a mistake while writing my precedent comment, maybe you could try the LATEST beta version, which is v4.0.0-beta.4 I think, if you haven't already tested it.

I saw your comment (#678 (comment)) and maybe I can give you some tips for solving the issues you encountered while testing the beta :

• You can use the brand new 'useExperimentalSnap' prop that will prevent any "fast swipe" or "multiple items swipe".
-> More info : https://github.com/archriss/react-native-snap-carousel/blob/master/doc/VERSION_4.md

• I'm sure there's some tricks that could replace the 'scrollEnabled' prop, but yeah it's for sure a "hacky way" to solve your problem.

As I said, be sure to install the LATEST version of the beta to avoid a whole bunch of bugs that are now almost entirely solved by the latest versions.

@bitttttten
Copy link
Author

I was on react-native-snap-carousel@4.0.0-beta.4 so looks like I was on beta 4 already.

It's a bit confusing, since it doesn't list here that scrollEnabled prop has been removed.

Thanks for your tip for the useExperimentalSnap! I missed that, but that looks like what I need :) I reverted back to v3 because I really need scrollEnabled for my use case, more so than snapToNext not animating. I'll keep an eye out on v4 though, as the upgrade was painless :)

@dohooo

This comment was marked as spam.

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

No branches or pull requests

3 participants