Giter Site home page Giter Site logo

Comments (8)

bd-arc avatar bd-arc commented on May 18, 2024

@NewOldMax Absolutely :) The only distinctive characteristic of your example is the background animation. In order to do that, you'll need to rely on the onSnapToItem prop. It will then be easy to update the color based on current slide's index.

Still, be aware that, as stated in this issue, the callback will be fired immediately after clicking. If this is not a deal-breaker for you, you're good to go.

Do not hesitate to share your experimentations!

from react-native-snap-carousel.

NewOldMax avatar NewOldMax commented on May 18, 2024

I already implemented it :)
It works fine with touches, but I have some issues with swipe, for example, i can't swipe to end of carousel at one time, or sometimes position of last element is wrong
asd25

from react-native-snap-carousel.

bd-arc avatar bd-arc commented on May 18, 2024

@NewOldMax Cool ;) Regarding your issues:

  • Scroll inertia varies depending on slide's size relative to viewport's size, e.g. the larger your slide is, the more difficult it is to swipe more than one slide at a time. You can try playing with this ScrollView prop and see if it helps.

  • The positioning issue is clearly the same as #33, but I wasn't able to reproduce it, either on a simulator nor a real device... Would you mind sharing the source code of your project so I can take a look at it? You can mail a zip file to me if you don't want it to go public ;)

from react-native-snap-carousel.

NewOldMax avatar NewOldMax commented on May 18, 2024

Would you mind sharing the source code of your project so I can take a look at it?

I'll create some reproduction component on next week.

You can try playing with this ScrollView prop and see if it helps.

Unfortunately I'm working only with android, so this prop couldn't help me :(

from react-native-snap-carousel.

bd-arc avatar bd-arc commented on May 18, 2024

Unfortunately I'm working only with android, so this prop couldn't help me :(

And does playing with enableMomentum change anything for you?

from react-native-snap-carousel.

NewOldMax avatar NewOldMax commented on May 18, 2024

As I remember, with momentum behavior was strange, but I'm not sure

from react-native-snap-carousel.

NewOldMax avatar NewOldMax commented on May 18, 2024

Seems to I fixed wrong offset with dynamic changing width of items.

const itemWidth = width * (index === 2 ? 0.6 : 0.65);

where index - index of selected item, index = 2 - my last item, and width - screen width
After this I can't reproduce case with wrong position.

from react-native-snap-carousel.

bd-arc avatar bd-arc commented on May 18, 2024

@NewOldMax Ok, good to know. I confirm that dynamically changing items' width will lead to issues since this value is critical for snap thresholds' calculation and must remain the same for all items.

from react-native-snap-carousel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.