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

Fix Native Rotation Android #18872

Closed
wants to merge 3 commits into from

Conversation

Projects
None yet
8 participants
@scisci
Copy link
Contributor

commented Apr 16, 2018

Fixes #14161
Android crashes in some cases if an animated transform config contains a string value, like a rotation.
This PR fixes that by ensuring all values sent to the native side are doubles. It adds __transformDataType to AnimatedTransform.js.

Test Plan

Added integration test ReactAndroid/src/androidText/js/AnimatedTransformTestModule.js This test fails with the following error INSTRUMENTATION_RESULT: longMsg=java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double, if the changes to AnimatedTransform.js are reverted.

changelog

[Android] [Fixed] - Fixes Android crash on animated style with string rotation

@scisci scisci changed the title adds __transformDataType to AnimatedTransform Fix Native Rotation Android Apr 16, 2018

@facebook-github-bot

This comment has been minimized.

Copy link

commented May 17, 2018

@scisci I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project.

@scisci

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2018

@henrikra

This comment has been minimized.

Copy link

commented Jun 4, 2018

I am waiting for this PR :)

@facebook-github-bot

This comment has been minimized.

Copy link

commented Jun 19, 2018

@scisci I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project.

@janicduplessis
Copy link
Collaborator

left a comment

Awesome work, sorry this got lost in my github notifications.

Just one small change to avoid some duplication of the deg parsing logic.

Show resolved Hide resolved Libraries/Animated/src/nodes/AnimatedTransform.js Outdated
@cpojer

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2019

@scisci it seems there are some problems with your PR. Would you mind rebasing it on master and making sure the JS tests pass?

@scisci scisci force-pushed the scisci:fix-native-rotation-android branch from 1ceaf73 to 243ca50 Jan 30, 2019

@analysis-bot
Copy link

left a comment

Code analysis results:

  • eslint found some issues.
@scisci

This comment has been minimized.

Copy link
Contributor Author

commented Jan 30, 2019

@cpojer, I rebased and tests are now passing

@janicduplessis

This comment has been minimized.

Copy link
Collaborator

commented Jan 31, 2019

@scisci Could you just address the lint issues that the bot pointed out? Especially the one about prettier since it might block landing this.

@scisci

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2019

@janicduplessis I've fixed the eslint errors.

@cpojer

cpojer approved these changes Jan 31, 2019

Copy link
Contributor

left a comment

Thanks so much for this fix, and bonus points to you for writing a test!

@facebook-github-bot
Copy link

left a comment

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot

This comment has been minimized.

Copy link
Collaborator

commented Jan 31, 2019

@scisci merged commit e405e84 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Jan 31, 2019

grabbou added a commit that referenced this pull request Feb 4, 2019

Fix Native Rotation Android (#18872)
Summary:
Fixes #14161
Android crashes in some cases if an animated transform config contains a string value, like a rotation.
This PR fixes that by ensuring all values sent to the native side are doubles. It adds `__transformDataType` to AnimatedTransform.js.

Added integration test `ReactAndroid/src/androidText/js/AnimatedTransformTestModule.js` This test fails with the following error `INSTRUMENTATION_RESULT: longMsg=java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double`, if the changes to AnimatedTransform.js are reverted.

[Android] [Fixed] - Fixes Android crash on animated style with string rotation
Pull Request resolved: #18872

Differential Revision: D13894676

Pulled By: cpojer

fbshipit-source-id: 297e8132563460802e53f3ac551c3ba9ed943736

@hramos hramos removed the Import Started label Feb 6, 2019

@hramos hramos removed the Import Started label Feb 6, 2019

matt-oakes pushed a commit to matt-oakes/react-native that referenced this pull request Feb 7, 2019

Fix Native Rotation Android (facebook#18872)
Summary:
Fixes facebook#14161
Android crashes in some cases if an animated transform config contains a string value, like a rotation.
This PR fixes that by ensuring all values sent to the native side are doubles. It adds `__transformDataType` to AnimatedTransform.js.

Added integration test `ReactAndroid/src/androidText/js/AnimatedTransformTestModule.js` This test fails with the following error `INSTRUMENTATION_RESULT: longMsg=java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double`, if the changes to AnimatedTransform.js are reverted.

[Android] [Fixed] - Fixes Android crash on animated style with string rotation
Pull Request resolved: facebook#18872

Differential Revision: D13894676

Pulled By: cpojer

fbshipit-source-id: 297e8132563460802e53f3ac551c3ba9ed943736
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.