Use int32_t for color representation on Android#53621
Open
lenaic wants to merge 1 commit intofacebook:mainfrom
Open
Use int32_t for color representation on Android#53621lenaic wants to merge 1 commit intofacebook:mainfrom
lenaic wants to merge 1 commit intofacebook:mainfrom
Conversation
Summary: This was originally changed from signed to unsigned here: D81230050. But because Android UI's `Color.valueOf` function uses a signed integer, we need to pass signed values to the android view when defining colors. See https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt?lines=82-82 The color value has to be between Integer.MIN_VALUE and Integer.MAX_VALUE. When passing an unsigned value, the value gets capped to the max signed value and results in another color being represented. Changelog: [Internal] Reviewed By: rshest Differential Revision: D81779878
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D81779878 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This was originally changed from signed to unsigned here: D81230050.
But because Android UI's
Color.valueOffunction uses a signed integer, we need to pass signed values to the android view when defining colors. See https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt?lines=82-82The color value has to be between Integer.MIN_VALUE and Integer.MAX_VALUE. When passing an unsigned value, the value gets capped to the max signed value and results in another color being represented.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D81779878