Skip to content

Commit dbbddee

Browse files
authored
Merge branch 'master' into master
2 parents fb6f8a5 + 0bcc6a4 commit dbbddee

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/refreshableScrollView.android.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import React from 'react'
22
import {
33
ActivityIndicator,
44
Animated,
5-
AsyncStorage,
65
Dimensions,
76
Easing,
87
ScrollView,
98
StyleSheet,
109
Text,
1110
View
1211
} from 'react-native'
12+
import AsyncStorage from '@react-native-community/async-storage'
1313
import dateFormat from './util'
1414

1515
const { width, height } = Dimensions.get('window')
@@ -25,7 +25,7 @@ const PaginationStatus = {
2525
allLoaded: 2
2626
}
2727

28-
export default class RefreshableScrollView extends ScrollView {
28+
export default class RefreshableScrollView extends React.Component {
2929
static defaultProps = {
3030
horizontal: false,
3131
scrollEnabled: true,
@@ -98,7 +98,8 @@ export default class RefreshableScrollView extends ScrollView {
9898
Animated.timing(this.state.arrowAngle, {
9999
toValue: 1,
100100
duration: 50,
101-
easing: Easing.inOut(Easing.quad)
101+
easing: Easing.inOut(Easing.quad),
102+
useNativeDriver: true,
102103
}).start()
103104
}
104105
} else if (this.state.refreshStatus !== RefreshStatus.pullToRefresh) {
@@ -109,7 +110,8 @@ export default class RefreshableScrollView extends ScrollView {
109110
Animated.timing(this.state.arrowAngle, {
110111
toValue: 0,
111112
duration: 50,
112-
easing: Easing.inOut(Easing.quad)
113+
easing: Easing.inOut(Easing.quad),
114+
useNativeDriver: true,
113115
}).start()
114116
}
115117
}
@@ -194,7 +196,8 @@ export default class RefreshableScrollView extends ScrollView {
194196
Animated.timing(this.state.arrowAngle, {
195197
toValue: 0,
196198
duration: 50,
197-
easing: Easing.inOut(Easing.quad)
199+
easing: Easing.inOut(Easing.quad),
200+
useNativeDriver: true,
198201
}).start()
199202
}
200203
}

src/refreshableScrollView.ios.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
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+
35
import dateFormat from './util'
46

57
const DATE_KEY = 'ultimateRefreshDate'
@@ -14,7 +16,7 @@ const PaginationStatus = {
1416
allLoaded: 2
1517
}
1618

17-
export default class RefreshableScrollView extends ScrollView {
19+
export default class RefreshableScrollView extends React.Component {
1820
static defaultProps = {
1921
horizontal: false,
2022
scrollEnabled: true,
@@ -82,7 +84,8 @@ export default class RefreshableScrollView extends ScrollView {
8284
Animated.timing(this.state.arrowAngle, {
8385
toValue: 1,
8486
duration: 50,
85-
easing: Easing.inOut(Easing.quad)
87+
easing: Easing.inOut(Easing.quad),
88+
useNativeDriver: true,
8689
}).start()
8790
} else {
8891
this.setState({
@@ -92,7 +95,8 @@ export default class RefreshableScrollView extends ScrollView {
9295
Animated.timing(this.state.arrowAngle, {
9396
toValue: 0,
9497
duration: 50,
95-
easing: Easing.inOut(Easing.quad)
98+
easing: Easing.inOut(Easing.quad),
99+
useNativeDriver: true,
96100
}).start()
97101
}
98102
}
@@ -163,7 +167,8 @@ export default class RefreshableScrollView extends ScrollView {
163167
Animated.timing(this.state.arrowAngle, {
164168
toValue: 0,
165169
duration: 50,
166-
easing: Easing.inOut(Easing.quad)
170+
easing: Easing.inOut(Easing.quad),
171+
useNativeDriver: true,
167172
}).start()
168173
this._scrollview.scrollTo({ x: 0, y: 0, animated: true })
169174
}

0 commit comments

Comments
 (0)