Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
Update outdated java custom view example on website
Browse files Browse the repository at this point in the history
Summary:The custom java view example on the website frontpage was pretty outdated :)

**Test plan (required)**
Tested by running the website locally.
Closes facebook#6435

Differential Revision: D3045976

fb-gh-sync-id: 7b9c48fe78988a7f2b329427a477a28abac99f11
shipit-source-id: 7b9c48fe78988a7f2b329427a477a28abac99f11
  • Loading branch information
janicduplessis authored and Facebook Github Bot 4 committed Mar 13, 2016
1 parent b5985cf commit cdb2d2e
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions website/src/react-native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,29 +328,19 @@ 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
protected MyCustomView createViewInstance(ThemedReactContext reactContext) {
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);
}
}
`}
Expand Down Expand Up @@ -387,4 +377,3 @@ module.exports = MyCustomView;
});

module.exports = index;

0 comments on commit cdb2d2e

Please sign in to comment.