Fix transparent color on Text on android
#55380
Open
+40
−25
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:
Fixes - #53343. Passing
transparentinto text color renders black color text on android.This broke with a fix implemented here. The issue is that if user passes
transparenttext color from JS, it gets converted to0value on platform. Currently,0is treated as Undefined on android, which causes this check to fail becausebooloverride function returns false thinking the passed color isUndefined😅 . Default text attribute is black color so android keeps the black color instead of overriding it withtransparent.This PR fixes it by removing the concept of
Undefinedplatform color and introducing adefinedproperty toSharedColor. This will make it consistent on different platforms. If user doesSharedColor(), they'll get an undefined color (in bool checks) andSharedColor(red)would give a defined shared color.Changelog:
[ANDROID] [FIXED] - Transparent text color renders black text.
Test Plan:
ColorTest.cpp