File tree Expand file tree Collapse file tree 7 files changed +122
-76
lines changed
src/main/java/com/example Expand file tree Collapse file tree 7 files changed +122
-76
lines changed Original file line number Diff line number Diff 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' ;
1717import Icon from 'react-native-vector-icons/Ionicons'
1818import { DotIndicator , SkypeIndicator } from 'react-native-indicators' ;
1919const 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 ( {
Original file line number Diff line number Diff line change @@ -137,8 +137,8 @@ android {
137137}
138138
139139dependencies {
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
Original file line number Diff line number Diff line change 33import android .app .Application ;
44
55import com .facebook .react .ReactApplication ;
6- import com .oblador .vectoricons .VectorIconsPackage ;
76import com .lmy .smartrefreshlayout .SmartRefreshLayoutPackage ;
7+ import com .oblador .vectoricons .VectorIconsPackage ;
88import com .facebook .react .ReactNativeHost ;
99import com .facebook .react .ReactPackage ;
1010import 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
Original file line number Diff line number Diff line change 11rootProject. name = ' Example'
2+ include ' :react-native-smartrefreshlayout'
3+ project(' :react-native-smartrefreshlayout' ). projectDir = new File (rootProject. projectDir, ' ../node_modules/react-native-smartrefreshlayout/android' )
24include ' :react-native-vector-icons'
35project(' :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-
76include ' :app'
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments