mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 22:12:42 +08:00
Add support for double type in ReactPropGroup
Reviewed By: astreet Differential Revision: D2735362 fb-gh-sync-id: a8eab400248fc4c8ad5d43e6a34cfd350dfb1d26
This commit is contained in:
committed by
facebook-github-bot-4
parent
e8659b3602
commit
c0c8e7cfdf
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user