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

[Android] Navigator transitions broken on 0.13 #3669

Closed
satya164 opened this issue Oct 25, 2015 · 16 comments
Closed

[Android] Navigator transitions broken on 0.13 #3669

satya164 opened this issue Oct 25, 2015 · 16 comments
Labels
Help Wanted :octocat: Issues ideal for external contributors. JavaScript Resolution: Locked This issue was locked by the bot.

Comments

@satya164
Copy link
Contributor

So, I upgraded my RN version in package.json and build.gradle and found that Navigator transitions are broken. I tried adding a configureScene property with no success.

navigator-example

@maxim-c
Copy link

maxim-c commented Oct 26, 2015

same issue. All configs Navigator.SceneConfigs with translate doesn't work, only this strange fade effect like in satya164 case.
FadeAndroid scene changes this ugly fade to little more better...

@mangogogos
Copy link
Contributor

+1

@pagrawl3
Copy link

same issue here as well, none of the slide transitions work, but the fade transitions work without a problem.

@astreet
Copy link
Contributor

astreet commented Oct 27, 2015

Thanks for the report and +1's everyone, @ericvicenti can you take a look?

@JonnyBGod
Copy link

+1

@satya164
Copy link
Contributor Author

satya164 commented Nov 2, 2015

Any updates on this?

@ericvicenti
Copy link
Contributor

I haven't seen any changes to Navigator that would cause this, and there is no platform-specific code that would cause breakage only on Android.

To perform animations, Navigator calls setNativeProps on views within a requestAnimationFrame timer.

Maybe somebody could try bisecting to identify the breakage? I don't have bandwidth to figure this out in the next few weeks.

@ide ide added the Help Wanted :octocat: Issues ideal for external contributors. label Nov 2, 2015
@mbrochh
Copy link

mbrochh commented Nov 3, 2015

I simply created the AwesomeProject tutorial and then added a Navigator to it and used the FloatFromRight transition. It works on iOS but it does not work on Android. The only transition that seems to work on Android is FadeAndroid, but that one is so subtle, it's hardly noticeable.

@davidstubbs
Copy link

I'm not entirely sure how it was broken, but the reason most transitions don't work is that they're using the wrong native prop.

buildStyleInterpolator creates a style with the transformMatrix property. Android expects the decomposed matrix in decomposedMatrix.

I hacked a change in Navigator.js _transitionSceneStyle which "fixes" the transitions (as in they work afterwards, but I'm sure this code change isn't really the one wanted):

    ...
    var didChange = useFn(styleToUse, directionAdjustedProgress);
    //
    if (styleToUse.transformMatrix)
      styleToUse = {...styleToUse, decomposedMatrix: MatrixMath.decomposeMatrix(styleToUse.transformMatrix)}
    //
    if (didChange) {
    ...

This is my first look at any of this code, so I'm very unsure how to go about fixing this for real.
Any pointers?

@ericvicenti
Copy link
Contributor

@astreet, have there been any recent changes to transform matrices? There seems to be an inconsistency with Android and iOS

@davidstubbs
Copy link

So a bit more research and...

The Android version relies on the scaleX/translateY/etc properties to get the transition.

A bunch of commits seemed to break that.

The problem is basically fixed already in 0ed3048
I applied that diff to my 0.13 install and it fixed the issue.

So this should be fixed in 0.14 already as long as all SceneConfigs use interpolators with fallbacks for transformTranslate.
There seems to be a lot of transform related props changes going on, especially with android, so I'm backing away slowly...

@astreet
Copy link
Contributor

astreet commented Nov 3, 2015

@kmagiera Were matrix transforms broken for a while in Android? I.e. possibly broken in the 0.13 release?

@satya164
Copy link
Contributor Author

satya164 commented Nov 5, 2015

This seems to be (kinda) fixed in master. Here's what happens on master,

2015-11-05 18_50_30

Notice the animation when I go back.

@sowdri
Copy link

sowdri commented Nov 6, 2015

The animation while going back kind of hangs for me as well while navigating back. Works fine in IOS though.

@qbig
Copy link
Contributor

qbig commented Nov 6, 2015

same here. the "back animation" is very choppy

@kmagiera
Copy link
Contributor

kmagiera commented Nov 9, 2015

@dgladkov's patch #3954 is fixing this issue - merging it now and closing this. Thanks all for reporting and special thanks to @dgladkov for investigating and fixing the problem

@kmagiera kmagiera closed this as completed Nov 9, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted :octocat: Issues ideal for external contributors. JavaScript Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests