1
1
import React from 'react'
2
- import { ActivityIndicator , Animated , AsyncStorage , Easing , ScrollView , StyleSheet , Text , View } from 'react-native'
2
+ import { ActivityIndicator , Animated , Easing , ScrollView , StyleSheet , Text , View } from 'react-native'
3
+ import AsyncStorage from '@react-native-community/async-storage'
4
+
3
5
import dateFormat from './util'
4
6
5
7
const DATE_KEY = 'ultimateRefreshDate'
@@ -14,7 +16,7 @@ const PaginationStatus = {
14
16
allLoaded : 2
15
17
}
16
18
17
- export default class RefreshableScrollView extends ScrollView {
19
+ export default class RefreshableScrollView extends React . Component {
18
20
static defaultProps = {
19
21
horizontal : false ,
20
22
scrollEnabled : true ,
@@ -82,7 +84,8 @@ export default class RefreshableScrollView extends ScrollView {
82
84
Animated . timing ( this . state . arrowAngle , {
83
85
toValue : 1 ,
84
86
duration : 50 ,
85
- easing : Easing . inOut ( Easing . quad )
87
+ easing : Easing . inOut ( Easing . quad ) ,
88
+ useNativeDriver : true ,
86
89
} ) . start ( )
87
90
} else {
88
91
this . setState ( {
@@ -92,7 +95,8 @@ export default class RefreshableScrollView extends ScrollView {
92
95
Animated . timing ( this . state . arrowAngle , {
93
96
toValue : 0 ,
94
97
duration : 50 ,
95
- easing : Easing . inOut ( Easing . quad )
98
+ easing : Easing . inOut ( Easing . quad ) ,
99
+ useNativeDriver : true ,
96
100
} ) . start ( )
97
101
}
98
102
}
@@ -163,7 +167,8 @@ export default class RefreshableScrollView extends ScrollView {
163
167
Animated . timing ( this . state . arrowAngle , {
164
168
toValue : 0 ,
165
169
duration : 50 ,
166
- easing : Easing . inOut ( Easing . quad )
170
+ easing : Easing . inOut ( Easing . quad ) ,
171
+ useNativeDriver : true ,
167
172
} ) . start ( )
168
173
this . _scrollview . scrollTo ( { x : 0 , y : 0 , animated : true } )
169
174
}
0 commit comments