Support ScrollAway in ReactScrollView

Summary:
Support ScrollAway in ReactScrollView for Fabric/non-Fabric.

Changelog: [Android][Added] Support for ScrollAway native nav bars added to ReactScrollView

Reviewed By: mdvacca

Differential Revision: D28308855

fbshipit-source-id: 9a922159ef50fb7c8e9c484a4b97ca57ab248496
This commit is contained in:
Joshua Gross
2021-05-10 12:14:57 -07:00
committed by Facebook GitHub Bot
parent d87542ee4c
commit 0ef5beee85
6 changed files with 84 additions and 18 deletions
@@ -43,12 +43,16 @@ public class ReactClippingViewGroupHelper {
// Intersect the view with the parent's rectangle
// This will result in the overlap with coordinates in the parent space
if (!sHelperRect.intersect(
view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
view.getLeft(),
view.getTop() + (int) view.getTranslationY(),
view.getRight(),
view.getBottom() + (int) view.getTranslationY())) {
outputRect.setEmpty();
return;
}
// Now we move the coordinates to the View's coordinate space
sHelperRect.offset(-view.getLeft(), -view.getTop());
sHelperRect.offset(-(int) view.getTranslationX(), -(int) view.getTranslationY());
sHelperRect.offset(view.getScrollX(), view.getScrollY());
outputRect.set(sHelperRect);
return;