Skip to content

Commit 06a5612

Browse files
committed
Add native driver support to flash anim.
1 parent 7bed992 commit 06a5612

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/QuickScrollList.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FastScroll extends React.Component {
4747

4848
onThumbDrag(event, gesture) {
4949
const { data, itemHeight, thumbHeight, viewportHeight } = this.props;
50-
// Animated.event([null, { dy: this.position.y }])(event, gesture);
50+
// Animated.event([null, { dy: this.position.y }], { useNativeDriver: true })(event, gesture);
5151
this.position.setValue({ x: 0, y: gesture.moveY });
5252
const thumbOffset = this.position.__getValue().y;
5353
const lastIndex = Math.floor((data.length * itemHeight - viewportHeight) / itemHeight) + 1;
@@ -75,7 +75,8 @@ class FastScroll extends React.Component {
7575
const { flashDuration, rightOffset } = this.props;
7676
Animated.timing(this.state.scrollBar, {
7777
toValue: ScreenWidth - rightOffset,
78-
duration: flashDuration
78+
duration: flashDuration,
79+
useNativeDriver: true
7980
}).start();
8081
};
8182

@@ -89,7 +90,8 @@ class FastScroll extends React.Component {
8990
const { flashDuration, flashOutDuration } = this.props;
9091
const flashOut = Animated.timing(this.state.scrollBar, {
9192
toValue: this.props.hiddenPosition,
92-
duration: flashDuration
93+
duration: flashDuration,
94+
useNativeDriver: true
9395
});
9496
setTimeout(() => flashOut.start(), flashOutDuration);
9597
this.props.onScrollEndDrag(event, gesture);

0 commit comments

Comments
 (0)