-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Added perspective transform support for Android #6926
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
Added perspective transform support for Android #6926
Conversation
By analyzing the blame information on this pull request, we identified @clickthisnick, @mkonicek and @kmagiera to be potential reviewers. |
Thanks for fixing the negative scale transform! cc @kmagiera who said he'd like to review this. |
By analyzing the blame information on this pull request, we identified @kmagiera, @clickthisnick and @mkonicek to be potential reviewers. |
@sebmarkbage would you mind taking a look at this pull request? It's been a while since the last commit was reviewed. |
Awesome work! Would be great if you could add this to UIExplorer too. |
any news? |
Is there any way I can help to get this merged? |
cc @lexs who might be able to review or find someone who can. |
@lexs Could you take a look please? |
Sorry for this getting lost. This code have changed a bunch so it will need to be rebased and updated: see https://github.com/facebook/react-native/blame/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java |
It looks like this pull request has been abandoned. Sorry for not getting a faster response in the first place - it does look like this functionality is pretty cool. I'm going to close this pull request but if you are still interested in working on it then please feel free to reopen it because the functionality does seem pretty cool. |
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Summary: Rebased facebook#6926 against master. Fixes facebook#2915 Closes facebook#11713 Differential Revision: D4513111 fbshipit-source-id: 9fb653c4bfd64eda12a605f6cabb0159b2af8f73
Hello gang 🙋🏼♂️ Perspective seems to work differently on Android in compare to android. Is anyone aware of these differences and maybe could guide me on what they are? |
On Android there is a default perspective set. I struggling to find its value. I have a 3d rotation that depends on the perspective value. Works great on iOS but fails on Android because, I don't know which value I should assume for the perspective: https://snack.expo.io/@wcandillon/instagram-stories I looked at the source code and tried some values like 1280, 1280density, or 1280density*5 without success. |
Note: This is an update to the original PR #6159, which got reverted with ae3dad8 after Issue #6622 arose. The old implementation didn't handle the case in which no perspective was set but negative scale or rotationX/Y transforms were applied (See here). This led in the old implementation to an infinite camera distance, resulting in the aforementioned issue #6622. That case is now handled -- I tested all cases described in #6622 to ensure that the Android behavior matches iOS.
Details of the original PR, which still apply: