Add support for double type in ReactPropGroup

Reviewed By: astreet

Differential Revision: D2735362

fb-gh-sync-id: a8eab400248fc4c8ad5d43e6a34cfd350dfb1d26
This commit is contained in:
Denis Koroskin
2015-12-09 12:34:24 -08:00
committed by facebook-github-bot-4
parent e8659b3602
commit c0c8e7cfdf
2 changed files with 20 additions and 1 deletions

View File

@@ -141,6 +141,11 @@ import com.facebook.react.bridge.ReadableMap;
mDefaultValue = defaultValue;
}
public DoublePropSetter(ReactPropGroup prop, Method setter, int index, double defaultValue) {
super(prop, "number", setter, index);
mDefaultValue = defaultValue;
}
@Override
protected Object extractProperty(CatalystStylesDiffMap props) {
return props.getDouble(mPropName, mDefaultValue);
@@ -366,6 +371,12 @@ import com.facebook.react.bridge.ReadableMap;
names[i],
new FloatPropSetter(annotation, method, i, annotation.defaultFloat()));
}
} else if (propTypeClass == double.class) {
for (int i = 0; i < names.length; i++) {
props.put(
names[i],
new DoublePropSetter(annotation, method, i, annotation.defaultDouble()));
}
} else if (propTypeClass == Integer.class) {
for (int i = 0; i < names.length; i++) {
props.put(