mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 22:41:28 +08:00
Convert modules to use @ReactModule instead of getName()
Reviewed By: astreet Differential Revision: D3334273 fbshipit-source-id: a33bf72c5c184844885ef3ef610a05d9c102c8ea
This commit is contained in:
committed by
Facebook Github Bot 2
parent
9965642ebc
commit
c64213653e
@@ -15,6 +15,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import com.facebook.react.bridge.BaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.JavaScriptModule;
|
||||
import com.facebook.react.bridge.annotations.ReactModule;
|
||||
import com.facebook.react.testing.ReactInstanceSpecForTest;
|
||||
import com.facebook.react.testing.ReactAppInstrumentationTestCase;
|
||||
|
||||
@@ -45,6 +46,8 @@ public abstract class AbstractScrollViewTestCase extends ReactAppInstrumentation
|
||||
}
|
||||
|
||||
// See ScrollViewListenerModule.js
|
||||
// Matches ScrollViewListenerModule.js
|
||||
@ReactModule(name = "ScrollListener")
|
||||
protected static class ScrollListenerModule extends BaseJavaModule {
|
||||
|
||||
private final ArrayList<Double> mXOffsets = new ArrayList<Double>();
|
||||
@@ -54,12 +57,6 @@ public abstract class AbstractScrollViewTestCase extends ReactAppInstrumentation
|
||||
private boolean mScrollBeginDragCalled;
|
||||
private boolean mScrollEndDragCalled;
|
||||
|
||||
// Matches ScrollViewListenerModule.js
|
||||
@Override
|
||||
public String getName() {
|
||||
return "ScrollListener";
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void onScroll(double x, double y) {
|
||||
mXOffsets.add(x);
|
||||
|
||||
Reference in New Issue
Block a user