Skip to content

Commit 90017b5

Browse files
javachemeta-codesync[bot]
authored andcommitted
Remove no-op MaintainVisibleScrollPositionHelper#updateScrollPosition() (#56535)
Summary: Pull Request resolved: #56535 Changelog: [Internal] Reviewed By: Abbondanzo Differential Revision: D101331886 fbshipit-source-id: fb655f3edab86ebf0cca5f19663337ab2dee7a9d
1 parent dbd3255 commit 90017b5

4 files changed

Lines changed: 1 addition & 19 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ internal class MaintainVisibleScrollPositionHelper<ScrollViewT>(
8282
uIManager.removeUIManagerEventListener(this)
8383
}
8484

85-
/**
86-
* Update the scroll position of the managed ScrollView. This should be called after layout has
87-
* been updated.
88-
*
89-
* On Fabric this will be called internally in `didMountItems`.
90-
*/
91-
fun updateScrollPosition() = Unit
92-
9385
private fun updateScrollPositionInternal() {
9486
val config = config ?: return
9587
val firstVisibleViewRef = firstVisibleViewRef ?: return

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,8 +1681,6 @@ public void onLayoutChange(
16811681
// does not work in RTL.
16821682
if (v.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
16831683
adjustPositionForContentChangeRTL(left, right, oldLeft, oldRight);
1684-
} else if (mMaintainVisibleContentPositionHelper != null) {
1685-
mMaintainVisibleContentPositionHelper.updateScrollPosition();
16861684
}
16871685
ReactScrollViewHelper.emitLayoutChangeEvent(this);
16881686
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<dd8221f4b150b4b3bec3dafd4b745482>>
7+
* @generated SignedSource<<74209bb4a44619a1ce16d68cfeeb0653>>
88
*/
99

1010
/**
@@ -1466,10 +1466,6 @@ public void onLayoutChange(
14661466
return;
14671467
}
14681468

1469-
if (mMaintainVisibleContentPositionHelper != null) {
1470-
mMaintainVisibleContentPositionHelper.updateScrollPosition();
1471-
}
1472-
14731469
if (isShown() && isContentReady()) {
14741470
int currentScrollY = getScrollY();
14751471
int maxScrollY = getMaxScrollY();

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,10 +1458,6 @@ public void onLayoutChange(
14581458
return;
14591459
}
14601460

1461-
if (mMaintainVisibleContentPositionHelper != null) {
1462-
mMaintainVisibleContentPositionHelper.updateScrollPosition();
1463-
}
1464-
14651461
if (isShown() && isContentReady()) {
14661462
int currentScrollY = getScrollY();
14671463
int maxScrollY = getMaxScrollY();

0 commit comments

Comments
 (0)