use of com.facebook.react.bridge.ReadableMap in project gl-react-native by ProjectSeptemberInc.
the class GLData method fromMap.
public static GLData fromMap(ReadableMap map) {
Integer shader = map.getInt("shader");
ReadableMap uniforms = map.getMap("uniforms");
Double width = map.getDouble("width");
Double height = map.getDouble("height");
Double pixelRatio = map.getDouble("pixelRatio");
Integer fboId = map.getInt("fboId");
List<GLData> children = fromArray(map.getArray("children"));
List<GLData> contextChildren = fromArray(map.getArray("contextChildren"));
return new GLData(shader, uniforms, width, height, pixelRatio, fboId, contextChildren, children);
}
use of com.facebook.react.bridge.ReadableMap in project react-native-fbsdk by facebook.
the class FBGraphRequestModule method buildParameters.
private Bundle buildParameters(ReadableMap parameterMap) {
Bundle parameters = new Bundle();
ReadableMapKeySetIterator keyIterator = parameterMap.keySetIterator();
while (keyIterator.hasNextKey()) {
String key = keyIterator.nextKey();
ReadableMap parameter = parameterMap.getMap(key);
if (parameter.hasKey("string")) {
parameters.putString(key, parameter.getString("string"));
}
}
return parameters;
}
use of com.facebook.react.bridge.ReadableMap in project react-native-fbsdk by facebook.
the class Utility method buildShareOpenGraphAction.
public static ShareOpenGraphAction buildShareOpenGraphAction(ReadableMap shareOpenGraphActionMap) {
ShareOpenGraphAction.Builder contentBuilder = new ShareOpenGraphAction.Builder();
contentBuilder.setActionType(shareOpenGraphActionMap.getString("actionType"));
ReadableMap properties = shareOpenGraphActionMap.getMap("_properties");
ReadableMapKeySetIterator keySetIterator = properties.keySetIterator();
while (keySetIterator.hasNextKey()) {
String key = keySetIterator.nextKey();
ReadableMap entry = properties.getMap(key);
contentBuilder.putObject(key, buildShareOpenGraphObject(entry.getMap("value")));
}
return contentBuilder.build();
}
use of com.facebook.react.bridge.ReadableMap in project react-native-fbsdk by facebook.
the class Utility method buildShareOpenGraphObject.
public static ShareOpenGraphObject buildShareOpenGraphObject(ReadableMap entry) {
ShareOpenGraphObject.Builder contentBuilder = new ShareOpenGraphObject.Builder();
ReadableMap value = entry.getMap("_properties");
ReadableMapKeySetIterator keySetIterator = value.keySetIterator();
while (keySetIterator.hasNextKey()) {
String key = keySetIterator.nextKey();
ReadableMap subEntry = value.getMap(key);
switch(subEntry.getString("type")) {
case "number":
contentBuilder.putDouble(key, subEntry.getDouble("value"));
break;
case "open-graph-object":
contentBuilder.putObject(key, buildShareOpenGraphObject(subEntry.getMap("value")));
break;
case "photo":
contentBuilder.putPhoto(key, buildSharePhoto(subEntry.getMap("value")));
break;
case "string":
contentBuilder.putString(key, subEntry.getString("value"));
break;
}
}
return contentBuilder.build();
}
use of com.facebook.react.bridge.ReadableMap in project react-native-fbsdk by facebook.
the class Utility method appendGenericContent.
private static void appendGenericContent(ShareContent.Builder contentBuilder, ReadableMap shareContent) {
if (shareContent.hasKey("commonParameters")) {
ReadableMap commonParameters = shareContent.getMap("commonParameters");
contentBuilder.setPeopleIds(commonParameters.hasKey("peopleIds") ? reactArrayToStringList(commonParameters.getArray("peopleIds")) : null);
contentBuilder.setPlaceId(getValueOrNull(commonParameters, "placeId"));
contentBuilder.setRef(getValueOrNull(commonParameters, "ref"));
if (commonParameters.hasKey("hashtag")) {
ShareHashtag tag = new ShareHashtag.Builder().setHashtag(commonParameters.getString("hashtag")).build();
contentBuilder.setShareHashtag(tag);
}
}
}
Aggregations