Java Code Examples for com.facebook.react.bridge.ReadableNativeArray

The following are top voted examples for showing how to use com.facebook.react.bridge.ReadableNativeArray. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RNLearn_Project1   File: BaseJavaModuleTest.java   View source code 6 votes vote down vote up
@Before
public void setup() {
  ModuleHolder moduleHolder = new ModuleHolder("MethodsModule",
    false,
    false,
    false,
    false,
    new Provider<MethodsModule>() {
      MethodsModule mModule;
      @Override
      public MethodsModule get() {
        mModule = new MethodsModule();
        return mModule;
      }
    });
  mWrapper = new JavaModuleWrapper(null, MethodsModule.class, moduleHolder);
  mMethods = mWrapper.getMethodDescriptors();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 2
Project: RNLearn_Project1   File: JavaModuleWrapper.java   View source code 5 votes vote down vote up
@DoNotStrip
public void invoke(ExecutorToken token, int methodId, ReadableNativeArray parameters) {
  if (mMethods == null || methodId >= mMethods.size()) {
    return;
  }

  mMethods.get(methodId).invoke(mJSInstance, token, parameters);
}
 
Example 3
Project: RNLearn_Project1   File: JavaModuleWrapper.java   View source code 5 votes vote down vote up
@DoNotStrip
public void invoke(ExecutorToken token, int methodId, ReadableNativeArray parameters) {
  if (mMethods == null || methodId >= mMethods.size()) {
    return;
  }

  mMethods.get(methodId).invoke(mJSInstance, token, parameters);
}
 
Example 4
Project: Ironman   File: JavaModuleWrapper.java   View source code 5 votes vote down vote up
@DoNotStrip
public void invoke(ExecutorToken token, int methodId, ReadableNativeArray parameters) {
  if (mMethods == null || methodId >= mMethods.size()) {
    return;
  }

  mMethods.get(methodId).invoke(mCatalystInstance, token, parameters);
}
 
Example 5
Project: react-native-sentry   File: RNSentryModule.java   View source code 5 votes vote down vote up
private static void addExceptionInterface(EventBuilder eventBuilder, String type, String value, ReadableNativeArray stack) {
    StackTraceInterface stackTraceInterface = new StackTraceInterface(convertToNativeStacktrace(stack));
    Deque<SentryException> exceptions = new ArrayDeque<>();

    exceptions.push(new SentryException(value, type, "", stackTraceInterface));

    eventBuilder.withSentryInterface(new ExceptionInterface(exceptions));
}
 
Example 6
Project: react-native-admob   File: RNPublisherBannerViewManager.java   View source code 5 votes vote down vote up
@ReactProp(name = PROP_VALID_AD_SIZES)
public void setPropValidAdSizes(final ReactPublisherAdView view, final ReadableArray adSizeStrings) {
    ReadableNativeArray nativeArray = (ReadableNativeArray)adSizeStrings;
    ArrayList<Object> list = nativeArray.toArrayList();
    String[] adSizeStringsArray = list.toArray(new String[list.size()]);
    AdSize[] adSizes = new AdSize[list.size()];

    for (int i = 0; i < adSizeStringsArray.length; i++) {
            String adSizeString = adSizeStringsArray[i];
            adSizes[i] = getAdSizeFromString(adSizeString);
    }
    view.setValidAdSizes(adSizes);
}
 
Example 7
Project: RNLearn_Project1   File: JSCJavaScriptExecutor.java   View source code 4 votes vote down vote up
public JSCJavaScriptExecutor(ReadableNativeArray jscConfig) {
  super(initHybrid(jscConfig));
}
 
Example 8
Project: RNLearn_Project1   File: JSCJavaScriptExecutor.java   View source code 4 votes vote down vote up
public JSCJavaScriptExecutor(ReadableNativeArray jscConfig) {
  super(initHybrid(jscConfig));
}
 
Example 9
Project: RNLearn_Project1   File: BaseJavaModuleTest.java   View source code 4 votes vote down vote up
@Before
public void setup() {
  mMethods = new MethodsModule().getMethods();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 10
Project: ReactNativeSignatureExample   File: BaseJavaModuleTest.java   View source code 4 votes vote down vote up
@Before
public void setup() {
  mMethods = new MethodsModule().getMethods();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 11
Project: react-native-ibeacon-android   File: BaseJavaModuleTest.java   View source code 4 votes vote down vote up
@Before
public void setup() {
  mMethods = new MethodsModule().getMethods();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 12
Project: magnet-client   File: ApiMagnetReact.java   View source code 4 votes vote down vote up
static private Object fromReactArgument(Object object) {
    if (object instanceof ReadableNativeArray) return ((ReadableNativeArray) object).toArrayList();
    else if (object instanceof ReadableNativeMap) return ((ReadableNativeMap) object).toHashMap();
    else return null;
}
 
Example 13
Project: react-native-box-loaders   File: BaseJavaModuleTest.java   View source code 4 votes vote down vote up
@Before
public void setup() {
  mMethods = new MethodsModule().getMethods();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 14
Project: Ironman   File: CxxModuleWrapper.java   View source code 4 votes vote down vote up
@Override
public native void invoke(
    CatalystInstance catalystInstance,
    ExecutorToken executorToken,
    ReadableNativeArray args);
 
Example 15
Project: Ironman   File: JSCJavaScriptExecutor.java   View source code 4 votes vote down vote up
public JSCJavaScriptExecutor(ReadableNativeArray jscConfig) {
  super(initHybrid(jscConfig));
}
 
Example 16
Project: Ironman   File: BaseJavaModuleTest.java   View source code 4 votes vote down vote up
@Before
public void setup() {
  mMethods = new MethodsModule().getMethods();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 17
Project: react-native-admob   File: RNPublisherBannerViewManager.java   View source code 4 votes vote down vote up
@ReactProp(name = PROP_TEST_DEVICES)
public void setPropTestDevices(final ReactPublisherAdView view, final ReadableArray testDevices) {
    ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices;
    ArrayList<Object> list = nativeArray.toArrayList();
    view.setTestDevices(list.toArray(new String[list.size()]));
}
 
Example 18
Project: react-native-admob   File: RNAdMobBannerViewManager.java   View source code 4 votes vote down vote up
@ReactProp(name = PROP_TEST_DEVICES)
public void setPropTestDevices(final ReactAdView view, final ReadableArray testDevices) {
    ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices;
    ArrayList<Object> list = nativeArray.toArrayList();
    view.setTestDevices(list.toArray(new String[list.size()]));
}
 
Example 19
Project: react-native-admob   File: RNAdMobRewardedVideoAdModule.java   View source code 4 votes vote down vote up
@ReactMethod
public void setTestDevices(ReadableArray testDevices) {
  ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices;
  ArrayList<Object> list = nativeArray.toArrayList();
  this.testDevices = list.toArray(new String[list.size()]);
}
 
Example 20
Project: react-native-admob   File: RNAdMobInterstitialAdModule.java   View source code 4 votes vote down vote up
@ReactMethod
public void setTestDevices(ReadableArray testDevices) {
    ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices;
    ArrayList<Object> list = nativeArray.toArrayList();
    this.testDevices = list.toArray(new String[list.size()]);
}
 
Example 21
Project: RNLearn_Project1   File: JSCJavaScriptExecutor.java   View source code votes vote down vote up
private native static HybridData initHybrid(ReadableNativeArray jscConfig); 
Example 22
Project: RNLearn_Project1   File: JSCJavaScriptExecutor.java   View source code votes vote down vote up
private native static HybridData initHybrid(ReadableNativeArray jscConfig); 
Example 23
Project: Ironman   File: JSCJavaScriptExecutor.java   View source code votes vote down vote up
private native static HybridData initHybrid(ReadableNativeArray jscConfig);