Skip to content

Commit

Permalink
Fix Java compilation errors from bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Apr 27, 2023
1 parent 5a922f4 commit ea34ef7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.facebook.react.bridge.UIManagerListener;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.uimanager.UIManagerHelper;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.react.uimanager.common.ViewUtil;
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasSmoothScroll;
import com.facebook.react.views.view.ReactViewGroup;
Expand Down Expand Up @@ -89,6 +90,14 @@ public void stop() {
* been updated.
*/
public void updateScrollPosition() {
// On Fabric this will be called internally in `didMountItems`.
if (ViewUtil.getUIManagerType(mScrollView.getId()) == UIManagerType.FABRIC) {
return;
}
updateScrollPositionInternal();
}

private void updateScrollPositionInternal() {
if (mConfig == null || mFirstVisibleView == null || mPrevFirstVisibleFrame == null) {
return;
}
Expand Down Expand Up @@ -169,6 +178,16 @@ public void run() {
});
}

@Override
public void willMountItems(UIManager uiManager) {
computeTargetView();
}

@Override
public void didMountItems(UIManager uiManager) {
updateScrollPositionInternal();
}

@Override
public void didDispatchMountItems(UIManager uiManager) {
// noop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,6 @@ public void setMaintainVisibleContentPosition(ReactScrollView view, ReadableMap
}
}

@ReactProp(name = "maintainVisibleContentPosition")
public void setMaintainVisibleContentPosition(ReactScrollView view, ReadableMap value) {
if (value != null) {
view.setMaintainVisibleContentPosition(
MaintainVisibleScrollPositionHelper.Config.fromReadableMap(value));
} else {
view.setMaintainVisibleContentPosition(null);
}
}

@Override
public Object updateState(
ReactScrollView view, ReactStylesDiffMap props, StateWrapper stateWrapper) {
Expand Down

0 comments on commit ea34ef7

Please sign in to comment.