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

Question: Smooth updates during property state changes #373

Closed
hggz opened this issue Aug 14, 2018 · 1 comment
Closed

Question: Smooth updates during property state changes #373

hggz opened this issue Aug 14, 2018 · 1 comment

Comments

@hggz
Copy link

hggz commented Aug 14, 2018

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

Question

Hey, first of all, thank you so much for maintaining this module. Its great (as I'm sure you guys already know from the popularity on this repo)

I have a question regarding a use case that I'm aware isn't technically designed to play well but I am using.

Would it be possible to ease state changes to the carousel during mid snapping events without showing a visible stutter to the component?

By that I mean, during the onBeforeSnapToItem() delegate, I'm listening to the current index displayed and changing the activeSlideAlignment property appropriately.

The behavior is:

index 0: start
index dataLength - 1: end
default: center

This works as expected but (understandably) theres a stutter during the state changes. Is there anyway you guys can recommend alleviating this?

I tried making the updates during the onScrollEvent and other delegates. The stutter isn't that bad when I use momentum but still noticeable.

Any advice would be appreciated. Thanks again!

@bd-arc
Copy link
Contributor

bd-arc commented Aug 16, 2018

Hi @hggz,

Thanks for the kind words; it's always nice to hear ;-)

Unfortunately, the real problem is that the ScrollView component - on which the plugin is ultimately based - doesn't provide any way of handling momentum, speed, velocity and such. No easing of any sort is currently possible. You can take a look at #189 for more info.

I've been considering implementing a custom PanResponder on top of the ScrollView (see #40) to solve that problem, but I have been taken aback by the amount of work so far :-)

I'm currently working on replacing the FlatList component altogether (see #250) with great hopes that this will smooth things out!

@bd-arc bd-arc closed this as completed Aug 16, 2018
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

2 participants