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

Animation seems slow #31

Open
iplus26 opened this issue Nov 17, 2015 · 11 comments
Open

Animation seems slow #31

iplus26 opened this issue Nov 17, 2015 · 11 comments

Comments

@iplus26
Copy link

iplus26 commented Nov 17, 2015

It's really convenient and easy for me to use gb-native-router, compared with NavigatorIOS I used before. But the animation seems slow and not that native. See below:

example

Is it the normal speed of transition? Or just because of my code is slow?
Is there any way to speed up the animation?

@MikaelCarpenter
Copy link
Owner

In NavBarContent.js theres this section

        Animated.timing(
          this.state.opacity,
          {
            fromValue: this.props.willDisappear ? 1 : 0,
            toValue: this.props.willDisappear ? 0 : 1,
            duration: 300,
            easing: Easing.easeOutQuad
          }
        ).start();

the duration is changeable. You can either manually change yours to something thats fitting, or if you'd like to make a PR you can make it dynamic by doing something like duration: this.props.duration ? 300 and make sure that this.props.duration is passed through the nav bar properly.

@iplus26
Copy link
Author

iplus26 commented Nov 17, 2015

Thanks for quick responding! I've tried changing the duration but still can't get what I want. My point is the animation is not that native. In this case, keyboard disappeared and title changed after the transition, while using in the iOS native animation, the changes should be in the same time with the transition. That's what I mean by 'slow animation'.

I'm wondering if there will be a solution because in the original repo README file, the animation seems quick enough, and like native.

Twitter navigation

@davidLeonardi
Copy link

It seems to me that this is caused by the way the code implements the callback to update state:
onDidFocus may be too late in the event chain. There is a comment about this in index.js that expresses a similar concern.
Anyone have any ideas how to improve this?

@iplus26
Copy link
Author

iplus26 commented Nov 18, 2015

@SEthX Yea.. I've noticed the comment. Looking forward to improvement.

@AlexGustafsson
Copy link

@SEthX, @iplus26 Have you guys updated the package? I've fixed the coherency in #21 and some other animation related things #26

EDIT:

My fixes seem to have been removed during @SEthX's(?) ES6 rewrite.
The fixes included coherent animation (which solved this issue), exposed route switch animation and a swipe-back fix. Should I submit a PR bringing them back or is someone on it?

@davidLeonardi
Copy link

@AlexGustafsson: Yes i see that, but the animations still seem to be firing
in the wrong moment.
I've updated to the latest revision of the source repository here.

On Sun, Nov 22, 2015 at 9:31 PM Alex Gustafsson [email protected]
wrote:

@SEthX https://github.com/sethx, @iplus26 https://github.com/iplus26
Have you guys updated the package? I've fixed the coherency in #21
#21 and some
other animation related things #26
#26


Reply to this email directly or view it on GitHub
#31 (comment)
.

@AlexGustafsson
Copy link

@SEthX: The fixes I made no longer seem to be part of the master repository. I can try to get a PR happen during the week. If you got time, you can see what changes I made in my PRs and implement them yourself. They're all minor and should be straightforward to implement.

@davidLeonardi
Copy link

Hm. I see a pattern here. Im afraid i might have nuked a bunch of changes
starting from the last release.
Ill go through the pr's today and reapply them one by one.
On Sun, 22 Nov 2015 at 22:14, Alex Gustafsson [email protected]
wrote:

@SEthX https://github.com/sethx: The fixes I made no longer seem to be
part of the master repository. I can try to get a PR happen during the
week. If you got time, you can see what changes I made in my PRs and
implement them yourself. They're all minor and should be straightforward to
implement.


Reply to this email directly or view it on GitHub
#31 (comment)
.

@AlexGustafsson
Copy link

@SEthX: great! Could you please take a look here as well? It's all I got on how to implement an interpolated animation for the swipe back.

@davidLeonardi
Copy link

@AlexGustafsson: What's the TL;DR of that ?

@AlexGustafsson
Copy link

@SEthX: Try to get the NavBar to animate according to how much a user drags the route back (from the left). So that its opacity changes when you "swipe to go back". The code listed in the end of the issue as close as I've gotten.

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

4 participants