Tried shared elements in an app and found a few issues.
- Don'\''t throw if other group is not found and just ignore the transition. Throwing is a bit aggressive since it'\''s possible the target screen doesn'\''t have the group yet (maybe it'\''s in a loading state).
- Properly measure when using pop. This bug happens when you pushed a screen with a transition and popping back if the shared element is in a ScrollView it was misplaced if the ScrollView scrolled. This is because measure wasn'\''t called for that screen so I moved check after measure has been done.
- Find other group as late as possible. Had some issues with relay (probably because it renders in a requestAnimationFrame) where it never found the other screen. We already wait for measure and an extra bit to make sure images loaded so we can get the other group right before using it instead.
Edit: Worked on this more as I found more bugs :)
- Get route / scene from context, this avoids having to pass around this.props.route, this is useful especially for SharedElements deep in a component tree.
- Check scene index when finding so when pushing the same route multiple times it still gets the right groups
- Check scene index at the start of . There was an issue that I'\''m not 100% sure why it happens but my app is using multiple navigators and it transitioned from the wrong screen sometimes. After investigating this I found out that was called multiple times for a single transition (probably once per navigator that has a route with a shared element transition) so checking if the index of the shared element group is part of the transition that is starting fixed it for my use case but there may be some edge cases where it can still fail (2 diff navigators, save route index maybe). If that happens I'\''ll have to find a better fix but this works for now.
- There was still some image flickers on iOS so I increased the delay by a significant margin, this is not ideal but will have to do for now.
Closesexponentjs/ex-navigation#209
fbshipit-source-id: f50e338
- Rename the old behaviour to FloatHorizontalIOS.
- It's becoming more common for apps on iOS to cross-fade the navigation components and not apply translateX like UINavigationController does by default. See: Facebook, Twitter, Instagram.
- This is hard to get it feeling 100% like UINavigationController, and while we should do that, let's be clear that it is an iOS specific look and feel.
- Default to this fade animation which in my opinion is more tasteful.
Closes#84
fbshipit-source-id: fc3e3bf