File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,18 @@ export default class LottieRefreshControl extends Component {
2020 _onRefresh = ( ) => {
2121 let { onRefresh} = this . props ;
2222 onRefresh && onRefresh ( ) ;
23+ this . lottieView . play ( this . state . scale . __getValue ( ) )
24+
2325 }
2426 finishRefresh = ( params ) => {
25- this . _refreshc && this . _refreshc . finishRefresh ( params )
27+ this . _refreshc && this . _refreshc . finishRefresh ( params ) ;
28+ this . lottieView . reset ( ) ;
2629 }
2730 _onHeaderMoving = ( event ) => {
28- this . state . scale . setValue ( event . nativeEvent . percent ) ;
31+ let { percent} = event . nativeEvent ;
32+ if ( percent <= 1 ) {
33+ this . state . scale . setValue ( event . nativeEvent . percent ) ;
34+ }
2935 }
3036 render ( ) {
3137 return (
@@ -44,7 +50,7 @@ export default class LottieRefreshControl extends Component {
4450 outputRange : [ 0.1 , 1 , 1 ] ,
4551 } )
4652 } ] } } >
47- < LottieView style = { { width :100 , height :100 } } hardwareAccelerationAndroid autoPlay source = { require ( './loop .json' ) } speed = { 1.5 } />
53+ < LottieView speed = { 2 } ref = { obj => this . lottieView = obj } style = { { width :100 , height :100 } } hardwareAccelerationAndroid progress = { this . state . scale } source = { require ( './cycle_animation .json' ) } />
4854 </ Animated . View >
4955 </ AnyHeader >
5056 }
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 77 "test" : " jest"
88 },
99 "dependencies" : {
10- "lottie-react-native" : " ^2.5.6 " ,
10+ "lottie-react-native" : " ^2.5.8 " ,
1111 "react" : " 16.3.1" ,
1212 "react-native" : " 0.55.4" ,
1313 "react-native-indicators" : " ^0.13.0" ,
Original file line number Diff line number Diff line change @@ -3327,9 +3327,9 @@ lottie-ios@^2.5.0:
33273327 version "2.5.0"
33283328 resolved "https://registry.npmjs.org/lottie-ios/-/lottie-ios-2.5.0.tgz#55c808e785d4a6933b0c10b395530b17098b05de"
33293329
3330- lottie-react-native@^2.5.6 :
3331- version "2.5.6 "
3332- resolved "https://registry.npmjs.org/lottie-react-native/-/lottie-react-native-2.5.6 .tgz#c5ad64a880108d50c728505ede10470a109c6e70 "
3330+ lottie-react-native@^2.5.8 :
3331+ version "2.5.8 "
3332+ resolved "https://registry.npmjs.org/lottie-react-native/-/lottie-react-native-2.5.8 .tgz#8599a077f4071f01d5e5215bcf50a3a8e67e7bc9 "
33333333 dependencies :
33343334 invariant "^2.2.2"
33353335 lottie-ios "^2.5.0"
You can’t perform that action at this time.
0 commit comments