|
@ -14,9 +14,10 @@ function ScrollingPicker(props) { |
|
|
const scrollX = useRef(new Animated.Value(0)).current; |
|
|
const scrollX = useRef(new Animated.Value(0)).current; |
|
|
|
|
|
|
|
|
function onScroll(event){ |
|
|
function onScroll(event){ |
|
|
if (event.nativeEvent.contentOffset.x === 0) { |
|
|
let rounded = Math.round(event.nativeEvent.contentOffset.x); |
|
|
|
|
|
if (rounded === 0) { |
|
|
props.modeSetter('square'); |
|
|
props.modeSetter('square'); |
|
|
} else if (event.nativeEvent.contentOffset.x === (Metrics.icons.buttonIcon * 2)) { |
|
|
} else if (rounded === (Metrics.icons.buttonIcon * 2)) { |
|
|
props.modeSetter('addition'); |
|
|
props.modeSetter('addition'); |
|
|
} |
|
|
} |
|
|
Animated.event([ |
|
|
Animated.event([ |
|
|