break; case Array: value = map.getArray(key); break; case Null:
break; case Array: value = map.getArray(key); break; case Null:
protected ShareFiles getFileShares(ReadableMap options) { if (ShareIntent.hasValidKey("type", options)) { return new ShareFiles(options.getArray("urls"), options.getString("type"), this.reactContext); } else { return new ShareFiles(options.getArray("urls"), this.reactContext); } } protected static String urlEncode(String param) {
@ReactMethod public void show(ReadableMap args, Callback callback) { Intent intent; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); } else { intent = new Intent(Intent.ACTION_PICK); } intent.addCategory(Intent.CATEGORY_OPENABLE); if (!args.isNull("filetype")) { ReadableArray filetypes = args.getArray("filetype"); if (filetypes.size() > 0) { intent.setType(filetypes.getString(0)); } } this.callback = callback; getReactApplicationContext().startActivityForResult(intent, READ_REQUEST_CODE, Bundle.EMPTY); }
static HashMap<String, Object> toHashMap(ReadableMap map) { HashMap<String, Object> hashMap = new HashMap<>(); ReadableMapKeySetIterator iterator = map.keySetIterator(); while (iterator.hasNextKey()) { String key = iterator.nextKey(); switch (map.getType(key)) { case Null: hashMap.put(key, null); break; case Boolean: hashMap.put(key, map.getBoolean(key)); break; case Number: hashMap.put(key, map.getDouble(key)); break; case String: hashMap.put(key, map.getString(key)); break; case Map: hashMap.put(key,toHashMap(map.getMap(key))); break; case Array: hashMap.put(key, toArrayList(map.getArray(key))); break; default: throw new IllegalArgumentException("Could not convert object with key: " + key + "."); } } return hashMap; }
break; case Array: deconstructedMap.put(key, OAuthManagerModule.recursivelyDeconstructReadableArray(readableMap.getArray(key))); break; default:
@ReactMethod public void showBottomSheetWithOptions(ReadableMap options, final Callback onSelect) { ReadableArray optionArray = options.getArray("options"); final Integer cancelButtonIndex = options.getInt("cancelButtonIndex"); final BottomSheet.Builder builder = new BottomSheet.Builder(this.getCurrentActivity()); // create options Integer size = optionArray.size(); for (int i = 0; i < size; i++) { builder.sheet(i, optionArray.getString(i)); } builder.listener(new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (which == cancelButtonIndex) { dialog.dismiss(); } else { onSelect.invoke(which); } } }); UiThreadUtil.runOnUiThread(new Runnable() { @Override public void run() { builder.build().show(); } }); }
ReadableArray arr = options.getArray("items"); for(int i = 0; i < arr.size(); i++){ simpleListAdapter.add(new MaterialSimpleListItem.Builder(getCurrentActivity())
break; case "items": ReadableArray arr = options.getArray("items"); String[] items = new String[arr.size()]; for (int i = 0; i < arr.size(); i++) {
ReadableArray arr = options.getArray("selectedIndices"); selectedIndices = new Integer[arr.size()]; for (int i = 0; i < arr.size(); i++) {