Skip to content

Commit

Permalink
Change Vertical ScrollView to take Context instead of ReactContext
Browse files Browse the repository at this point in the history
Summary:
The `ReactScrollView.java` constructor is using `ReactContext` instead of `Context`, which is inconsistent to the horizontal scroll view. This is the result from D3863966 (2cf2fdb) when an OSS issue needs to be addressed. That issue and all call sites to use the `ReactContext` are deprecated now.

Revert this back to use `Context` to be less restrictive.

Changelog:
[Android][Fixed] - Revert `ReactScrollView` to use `Context` instead of `ReactContext` in the constructor to be less restrictive.

Reviewed By: javache

Differential Revision: D31819799

fbshipit-source-id: 3f00d64850aebd2e20615033b2e1f1c721fed37e
  • Loading branch information
ryancat authored and facebook-github-bot committed Oct 21, 2021
1 parent eccbf9b commit 7b77cc6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
Expand All @@ -34,7 +35,6 @@
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.R;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.common.ReactConstants;
Expand Down Expand Up @@ -114,11 +114,11 @@ public class ReactScrollView extends ScrollView
private int mLastStateUpdateScrollX = -1;
private int mLastStateUpdateScrollY = -1;

public ReactScrollView(ReactContext context) {
public ReactScrollView(Context context) {
this(context, null);
}

public ReactScrollView(ReactContext context, @Nullable FpsListener fpsListener) {
public ReactScrollView(Context context, @Nullable FpsListener fpsListener) {
super(context);
mFpsListener = fpsListener;
mReactBackgroundManager = new ReactViewBackgroundManager(this);
Expand Down

0 comments on commit 7b77cc6

Please sign in to comment.