AndroidTextInput uses default padding from Android theme

Summary:
For backwards-compatibility with Paper, we're implementing a feature in Fabric that will allow TextInputs to use the default padding from the theme in Android.

Note that this uses some pretty ugly hacks that probably shouldn't be used inside of components at all: looking directly at rawProps, overriding props/Yoga styles in the component descriptor, etc. I would (personally) really like to kill this feature entirely unless and until we can find a more elegant solution.

Changelog: [Internal]

TextInputs are still not pixel-perfect with Paper, but they're much closer, and the underline visual glitchiness is no longer an issue.

Reviewed By: mdvacca

Differential Revision: D20109605

fbshipit-source-id: 543282843e0a9f03a504d72d7a014431099bd64c
This commit is contained in:
Joshua Gross authored and Facebook Github Bot committed 2020-02-26 13:46:57 -08:00
1 parent 6ea963de6a
commit 5be86695a3
7 files changed
+178 -8

No files matched your search

@@ -21,6 +21,7 @@ folly::dynamic AndroidTextInputState::getDynamic() const {
newState["attributedString"] = toDynamic(attributedString);
newState["paragraphAttributes"] = toDynamic(paragraphAttributes);
newState["hash"] = newState["attributedString"]["hash"];
newState["hasThemeData"] = !isnan(defaultThemePaddingStart);
return newState;
}
#endif