Update outdated java custom view example on website

Summary:The custom java view example on the website frontpage was pretty outdated :)

**Test plan (required)**
Tested by running the website locally.
Closes https://github.com/facebook/react-native/pull/6435

Differential Revision: D3045976

fb-gh-sync-id: 7b9c48fe78988a7f2b329427a477a28abac99f11
shipit-source-id: 7b9c48fe78988a7f2b329427a477a28abac99f11
This commit is contained in:
Janic Duplessis 2016-03-12 16:46:54 -08:00 committed by Facebook Github Bot 4
parent b5985cf690
commit cdb2d2ee79

View File

@ -328,15 +328,9 @@ var Message = React.createClass({
{`// Java
public class MyCustomViewManager extends SimpleViewManager<MyCustomView> {
private static final String REACT_CLASS = "MyCustomView";
@UIProp(UIProp.Type.STRING)
public static final String PROP_MY_CUSTOM_PROPERTY = "myCustomProperty";
@Override
public String getName() {
return REACT_CLASS;
return "MyCustomView";
}
@Override
@ -344,13 +338,9 @@ public class MyCustomViewManager extends SimpleViewManager<MyCustomView> {
return new MyCustomView(reactContext);
}
@Override
public void updateView(MyCustomView view, ReactStylesDiffMap props) {
super.updateView(view, props);
if (props.hasKey(PROP_MY_CUSTOM_PROPERTY)) {
view.setMyCustomProperty(props.getString(PROP_MY_CUSTOM_PROPERTY));
}
@ReactProp(name = "myCustomProperty")
public void setMyCustomProperty(MyCustomView view, String value) {
view.setMyCustomProperty(value);
}
}
`}
@ -387,4 +377,3 @@ module.exports = MyCustomView;
});
module.exports = index;