Skip to content

Commit 3eb35d5

Browse files
committed
Update Example
1 parent ea3563b commit 3eb35d5

File tree

7 files changed

+122
-76
lines changed

7 files changed

+122
-76
lines changed

.idea/workspace.xml

Lines changed: 106 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/App.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ScrollView,
1414
Animated,
1515
} from 'react-native';
16-
import {SmartRefreshControl, AnyHeader} from 'react-native-smartrefreshlayout-next';
16+
import {SmartRefreshControl, AnyHeader} from 'react-native-smartrefreshlayout';
1717
import Icon from 'react-native-vector-icons/Ionicons'
1818
import {DotIndicator,SkypeIndicator} from 'react-native-indicators';
1919
const AnimatedIcon = Animated.createAnimatedComponent(Icon)
@@ -38,6 +38,11 @@ export default class App extends Component<Props> {
3838
refreshControl={
3939
<SmartRefreshControl
4040
ref={ref=>this._refreshc = ref}
41+
onRefresh={()=>{
42+
setTimeout(()=>{
43+
this._refreshc && this._refreshc.finishRefresh();
44+
},1000)
45+
}}
4146
onPullDownToRefresh={()=>{
4247
this.setState({
4348
text:'下拉刷新',
@@ -50,14 +55,11 @@ export default class App extends Component<Props> {
5055
}).start()
5156
}
5257
}
53-
onRefresh={()=>{
58+
onHeaderReleased={()=>{
5459
this.setState({
5560
refreshing:true,
5661
text:'正在刷新'
5762
})
58-
setTimeout(()=>{
59-
this._refreshc && this._refreshc.finishRefresh();
60-
},1000)
6163
}}
6264
onReleaseToRefresh={()=>{
6365
this.setState({

Example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ android {
137137
}
138138

139139
dependencies {
140+
compile project(':react-native-smartrefreshlayout')
140141
compile project(':react-native-vector-icons')
141-
compile project(':react-native-smartrefreshlayout-next')
142142
compile fileTree(dir: "libs", include: ["*.jar"])
143143
compile "com.android.support:appcompat-v7:23.0.1"
144144
compile "com.facebook.react:react-native:+" // From node_modules

Example/android/app/src/main/java/com/example/MainApplication.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import android.app.Application;
44

55
import com.facebook.react.ReactApplication;
6-
import com.oblador.vectoricons.VectorIconsPackage;
76
import com.lmy.smartrefreshlayout.SmartRefreshLayoutPackage;
7+
import com.oblador.vectoricons.VectorIconsPackage;
88
import com.facebook.react.ReactNativeHost;
99
import com.facebook.react.ReactPackage;
1010
import com.facebook.react.shell.MainReactPackage;
@@ -25,9 +25,8 @@ public boolean getUseDeveloperSupport() {
2525
protected List<ReactPackage> getPackages() {
2626
return Arrays.<ReactPackage>asList(
2727
new MainReactPackage(),
28-
new VectorIconsPackage(),
29-
new SmartRefreshLayoutPackage()
30-
);
28+
new SmartRefreshLayoutPackage(),
29+
new VectorIconsPackage() );
3130
}
3231

3332
@Override

Example/android/settings.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
rootProject.name = 'Example'
2+
include ':react-native-smartrefreshlayout'
3+
project(':react-native-smartrefreshlayout').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-smartrefreshlayout/android')
24
include ':react-native-vector-icons'
35
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
4-
include ':react-native-smartrefreshlayout-next'
5-
project(':react-native-smartrefreshlayout-next').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-smartrefreshlayout-next/android')
6-
76
include ':app'

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"react": "16.3.1",
1111
"react-native": "0.55.4",
1212
"react-native-indicators": "^0.13.0",
13-
"react-native-smartrefreshlayout-next": "^0.5.1",
13+
"react-native-smartrefreshlayout": "^0.5.1",
1414
"react-native-vector-icons": "^4.6.0"
1515
},
1616
"devDependencies": {

Example/yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4171,9 +4171,9 @@ react-native-indicators@^0.13.0:
41714171
dependencies:
41724172
prop-types "^15.5.10"
41734173

4174-
react-native-smartrefreshlayout-next@^0.5.1:
4174+
react-native-smartrefreshlayout@^0.5.1:
41754175
version "0.5.1"
4176-
resolved "https://registry.npmjs.org/react-native-smartrefreshlayout-next/-/react-native-smartrefreshlayout-next-0.5.1.tgz#bc8263a50a491adaa8880384bde250eace962d18"
4176+
resolved "https://registry.npmjs.org/react-native-smartrefreshlayout/-/react-native-smartrefreshlayout-0.5.1.tgz#dbe3a9108d9e14bfdeb691a5e8baf7e801ca3237"
41774177
dependencies:
41784178
prop-types "*"
41794179

0 commit comments

Comments
 (0)