react-native-quick-scroll
Advanced tools
Comparing version 1.1.3 to 1.2.0
{ | ||
"name": "react-native-quick-scroll", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "Faisal Arshed", |
@@ -55,4 +55,5 @@ # react-native-quick-scroll [![npm version](https://img.shields.io/npm/v/react-native-quick-scroll.svg?style=flat)](https://www.npmjs.com/package/react-native-quick-scroll) | ||
# Todo (PRs welcome!) | ||
- [ ] Add native driver support | ||
- [x] Add native driver support | ||
- [ ] Implement with [react-native-interactable](https://github.com/wix/react-native-interactable) for better performance | ||
- [ ] Rewrite with TypeScript | ||
- [ ] Add support for FlatList ref |
@@ -50,3 +50,3 @@ import React from 'react'; | ||
const { data, itemHeight, thumbHeight, viewportHeight } = this.props; | ||
// Animated.event([null, { dy: this.position.y }])(event, gesture); | ||
// Animated.event([null, { dy: this.position.y }], { useNativeDriver: true })(event, gesture); | ||
this.position.setValue({ x: 0, y: gesture.moveY }); | ||
@@ -79,3 +79,4 @@ const thumbOffset = this.position.__getValue().y; | ||
toValue: ScreenWidth - rightOffset, | ||
duration: flashDuration | ||
duration: flashDuration, | ||
useNativeDriver: true | ||
}).start(); | ||
@@ -94,3 +95,4 @@ }; | ||
toValue: this.props.hiddenPosition, | ||
duration: flashDuration | ||
duration: flashDuration, | ||
useNativeDriver: true | ||
}); | ||
@@ -164,20 +166,15 @@ setTimeout(() => flashOut.start(), flashOutDuration); | ||
width: 10, | ||
backgroundColor: 'transparent' | ||
backgroundColor: 'transparent', | ||
alignItems: 'center' | ||
}, | ||
touchArea: { | ||
position: 'absolute', | ||
backgroundColor: 'transparent' | ||
backgroundColor: 'black', | ||
alignItems: 'center' | ||
}, | ||
thumb: { | ||
position: 'absolute', | ||
width: 7, | ||
width: 6, | ||
borderRadius: 4, | ||
backgroundColor: 'white', | ||
borderWidth: 0.2, | ||
borderColor: 'black', | ||
backgroundColor: '#4C4C4C', | ||
elevation: 2 | ||
} | ||
}; | ||
// event.nativeEvent.pageY; //distance of TOUCH from the top of the screen | ||
// this.position.__getValue().y; //distance of thumb from the top of the screen |
58
7558
163