Skip to content

Commit 136ca93

Browse files
committed
发布1.0.6
1 parent a4ad9a6 commit 136ca93

File tree

15 files changed

+349
-338
lines changed

15 files changed

+349
-338
lines changed

README.md

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,35 @@ dependencies {
2828
}
2929
```
3030

31-
* register module (in MainActivity.java)
31+
* register module (in MainApplication.java)
3232

3333
```java
34-
import com.remobile.filetransfer.*; // <--- import
35-
36-
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
37-
......
38-
@Override
39-
protected void onCreate(Bundle savedInstanceState) {
40-
super.onCreate(savedInstanceState);
41-
mReactRootView = new ReactRootView(this);
42-
43-
mReactInstanceManager = ReactInstanceManager.builder()
44-
.setApplication(getApplication())
45-
.setBundleAssetName("index.android.bundle")
46-
.setJSMainModuleName("index.android")
47-
.addPackage(new MainReactPackage())
48-
.addPackage(new RCTFileTransferPackage()) // <------ add here
49-
.setUseDeveloperSupport(BuildConfig.DEBUG)
50-
.setInitialLifecycleState(LifecycleState.RESUMED)
51-
.build();
52-
53-
mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
54-
55-
setContentView(mReactRootView);
56-
}
57-
58-
......
34+
......
35+
import com.remobile.filetransfer.RCTFileTransferPackage; // <--- import
36+
37+
......
38+
39+
@Override
40+
protected List<ReactPackage> getPackages() {
41+
......
42+
new RCTFileTransferPackage(), // <------ add here
43+
......
5944
}
45+
6046
```
6147

6248
## Usage
6349

6450
### Example
6551
```js
66-
var React = require('react-native');
52+
var React = require('react');
53+
var ReactNative = require('react-native');
6754
var {
6855
StyleSheet,
6956
NativeAppEventEmitter,
7057
View,
7158
Text,
72-
} = React;
59+
} = ReactNative;
7360

7461
var FileTransfer = require('@remobile/react-native-file-transfer');
7562
var Button = require('@remobile/react-native-simple-button');
@@ -145,3 +132,7 @@ var styles = StyleSheet.create({
145132

146133
### thanks
147134
* this project come from https://github.com/apache/cordova-plugin-file-transfer
135+
136+
137+
### see detail use
138+
* https://github.com/remobile/react-native-template

android/build.gradle

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ android {
2121
dependencies {
2222
compile fileTree(dir: 'libs', include: ['*.jar'])
2323
compile 'com.android.support:appcompat-v7:23.0.1'
24-
compile 'com.facebook.react:react-native:0.16.+'
24+
compile 'com.facebook.react:react-native:+'
2525
compile project(':react-native-cordova')
2626
}

android/src/main/AndroidManifest.xml

100644100755
File mode changed.

android/src/main/java/com/remobile/filetransfer/FileProgressResult.java

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void setTotal(long bytes) {
5757
public JSONObject toJSONObject() throws JSONException {
5858
return new JSONObject(
5959
"{loaded:" + loaded +
60-
",total:" + total +
61-
",lengthComputable:" + (lengthComputable ? "true" : "false") + "}");
60+
",total:" + total +
61+
",lengthComputable:" + (lengthComputable ? "true" : "false") + "}");
6262
}
6363
}

0 commit comments

Comments
 (0)