question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Snap to next does not animate on Android

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
ajacquierbretcommented, Jul 4, 2020

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 (https://github.com/archriss/react-native-snap-carousel/pull/678#issuecomment-653755797) 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.

1reaction
ajacquierbretcommented, Jul 4, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Snap to next does not animate on Android · Issue #721 - GitHub
When calling carouselRef.current.snapToItem(lastItemIndex) the carousel does not animate to the position, it just snaps there. On iOS it does ...
Read more >
Animation | Jetpack Compose - Android Developers
Overview. Animations are essential in a modern mobile app in order to realize a smooth and understandable user experience. Many Jetpack Compose Animation...
Read more >
Android: Animation Position Resets After Complete
The animations are working as expected. Just because you animated something does not mean you actually moved it. An animation only affects drawn...
Read more >
React Native Reanimated 2 : Implementing a simple snap to ...
React Native Reanimated 2 : Implementing a simple snap to corner gesture animation. Smooth 60 frames per second animations even on low end ......
Read more >
Animate with Jetpack Compose: Animate as State and ...
So Jetpack Compose officially becomes the future of Android Development. ... We are not going to change the size or visibility.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found