Skip to content

Commit

Permalink
Back out "Account for diffrent frame size when using maintainVisibleC…
Browse files Browse the repository at this point in the history
…ontentPosition in virtualized lists" (facebook#47125)

Summary:
Pull Request resolved: facebook#47125

Original commit changeset: 9f05a461d178

Original Phabricator Diff: D64238887

Changelog: [Internal]

NOTE: while this seems to work on IGVR it breaks on the two use cases highlighted in D64339251, backing out the diff while trying to find out a solution that works on all cases!

Reviewed By: Abbondanzo

Differential Revision: D64611594

fbshipit-source-id: b43353b17448c181a76b2af09968cf0e4934c53c
  • Loading branch information
fabriziocucci authored and facebook-github-bot committed Oct 18, 2024
1 parent 16ceb6f commit f3e37e2
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ private void updateScrollPositionInternal() {
firstVisibleView.getHitRect(newFrame);

if (mHorizontal) {
int deltaX =
(newFrame.left - mPrevFirstVisibleFrame.left)
+ (newFrame.width() - mPrevFirstVisibleFrame.width());
int deltaX = newFrame.left - mPrevFirstVisibleFrame.left;
if (deltaX != 0) {
int scrollX = mScrollView.getScrollX();
mScrollView.scrollToPreservingMomentum(scrollX + deltaX, mScrollView.getScrollY());
Expand All @@ -128,9 +126,7 @@ private void updateScrollPositionInternal() {
}
}
} else {
int deltaY =
(newFrame.top - mPrevFirstVisibleFrame.top)
+ (newFrame.height() - mPrevFirstVisibleFrame.height());
int deltaY = newFrame.top - mPrevFirstVisibleFrame.top;
if (deltaY != 0) {
int scrollY = mScrollView.getScrollY();
mScrollView.scrollToPreservingMomentum(mScrollView.getScrollX(), scrollY + deltaY);
Expand Down

0 comments on commit f3e37e2

Please sign in to comment.