Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hongyin163 committed Jan 9, 2017
1 parent 8c7d516 commit eb5e1b6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,28 @@ dependencies {
```java
import cn.mandata.react_native_mpchart.MPChartPackage; // <--- import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);

mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new MPChartPackage()) // <------ add this line to yout MainActivity class
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();

mReactRootView.startReactApplication(mReactInstanceManager, "AndroidRNSample", null);

setContentView(mReactRootView);
}

......

public class MainActivity extends ReactActivity {

......

/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReactNativeIcons(Arrays.asList(
new IconFont("typicons", "typicons.ttf"),
new IconFont("fontawesome", "FontAwesome.otf")
)),
new MPChartPackage(),// <------ add this line to yout MainActivity class
new ManDataLibPackage(),
new BaiduVoiseLibPackage()
);
}
......
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-chart-android",
"version": "1.0.6",
"version": "1.0.8",
"description": "react-native-mpchart provide modules to add chart to android,all charts are come from mpandroidchart library.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit eb5e1b6

Please sign in to comment.