Java Code Examples for com.facebook.react.bridge.ReadableNativeArray#toArrayList()

The following examples show how to use com.facebook.react.bridge.ReadableNativeArray#toArrayList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RNPublisherBannerViewManager.java    From react-native-admob with BSD 2-Clause "Simplified" License 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 2
Source File: RNPublisherBannerViewManager.java    From react-native-admob with BSD 2-Clause "Simplified" License 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 3
Source File: RNAdMobBannerViewManager.java    From react-native-admob with BSD 2-Clause "Simplified" License 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 4
Source File: RNAdMobRewardedVideoAdModule.java    From react-native-admob with BSD 2-Clause "Simplified" License 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 5
Source File: RNAdMobInterstitialAdModule.java    From react-native-admob with BSD 2-Clause "Simplified" License 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()]);
}