-
-
Notifications
You must be signed in to change notification settings - Fork 518
Add native driver support for Bar and smooth animation #57
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
Conversation
@oblador any chance to merge this? Or any kind of feedback? |
@nerdmed would this pull request help to address the following type of issue?
|
@MrHubble possibly yes! But i have only implemented it for the progress bar. The Circle animation code is quite harry and not straight forward to work with, but it should be also possible to implement it there. |
This is cool @nerdmed! Why did you change the animation to a timing instead of a spring? |
@oblador we are using the progress bar like a real one for audio playback. As soon as you use spring easing and changing the value frequently it also stutters and looks strange. A progressbar used for imperative progress should not animate with a spring? Do you think its legit here or not really whats intended? |
OK, gotcha. However I don't want to make an unnecessary breaking change and also break my use case . Perhaps it would be better to expose some props to configure the animation? Like duration/bounciness/easing etc. |
will do! I think i will find some time at the weekend! |
1b83cbf
to
d42e978
Compare
@oblador alright now i have changed the way it works. Users can optionally override the animation function and config. I tried a little bit with a function as a prob but it gets quite messy and complicated to pass a function that returns a functions that takes the internal progress. What do you think of this kind of API? The current state does not change or break the behaviour compared to the old version. |
@oblador here is an example how i am using it in my project with the new optional API
|
@oblador Any feedback? |
Would love to try this 👍 |
Looks good @nerdmed, just need to find some time to properly review and test it again. Thanks for your patience! |
Looks great! I'm going to merge this and make some change to the props API myself. Thanks again! |
Released in 3.4.0. |
@nerdmed @oblador thanks so much for adding this functionality. When I use to this: with code: <ProgressBar
useNativeDriver
indeterminate={true}
height={50} width={300} color={"#df691a"} unfilledColor={"#4e5d6c"} borderWidth={0}
/> Any idea what I'm doing wrong here? UpdateWhen I use the correct syntax of |
@MrHubble can you try to disable: |
@nerdmed thanks for taking the time to response. I'm actually not updating the progress in this instance and am using the |
@MrHubble I am not sure what the problem is. I was just guessing cause after reading the source code i was impressed how complicated this indeterminate stuff makes all the code. If you could provide a small react native example with your problem i could try to debug it with you. |
@nerdmed I'm really stumped with this one. I created a sample app with create-react-native-app (CRNA) and it worked fine, I then copied that code to my app (with a few minor modifications ie using I've checked that versions match in The only thing I can think to try is to manually set the |
@oblador thanks for that great lib! I have had some issues with the progress bar being jaggy while animating. Here is a suggestion that encourages the new RN native driver, i
I have tried to do the same to the circles but i get stuck with a JSON error. I think its coming from the SVG parsing or something. If you are interested to try it out see e80c8f7