Fix RTL scrolling

Summary:
We recently fixed RTL scrolling in Fabric on iOS: D26608231 (https://github.com/facebook/react-native/commit/e5921f7f384af45df4f355fa3fa1b58a20a269d3)

Turns out, the mechanism for RTL scrolling on Android is completely different. It requires that content be wrapped in a "directional content view", which is `View` in LTR and `AndroidHorizontalScrollContentView` in RTL, backed by `ReactHorizontalScrollContainerView.java`.

iOS doesn't require that and just uses View and some custom logic in ScrollView itself.

In the future it would be great to align the platforms, but for now, for backwards-compat with non-Fabric and so we don't have to tear apart ScrollView.js, we codegen the AndroidHorizontalScrollContentView so it exists in C++, register the component, and stop mapping it to View explicitly in C++.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26659686

fbshipit-source-id: 3b9c646dbdb7fe9527d24d42bdc6acb1aca00945
This commit is contained in:
Joshua Gross
2021-02-25 10:06:56 -08:00
committed by Facebook GitHub Bot
parent eeb36f4709
commit 4e243ca7a3
3 changed files with 18 additions and 18 deletions
@@ -64,6 +64,9 @@ CoreComponentsRegistry::sharedProviderRegistry() {
concreteComponentDescriptorProvider<SliderComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<ScrollViewComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<
AndroidHorizontalScrollContentViewComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<ParagraphComponentDescriptor>());
providerRegistry->add(concreteComponentDescriptorProvider<