|
@ -8,11 +8,10 @@ import Icons from '../themes/Icons'; |
|
|
import Colors from "../themes/Colors"; |
|
|
import Colors from "../themes/Colors"; |
|
|
import Metrics from "../themes/Metrics"; |
|
|
import Metrics from "../themes/Metrics"; |
|
|
import { styles } from "../screens/styles/AppStyles"; |
|
|
import { styles } from "../screens/styles/AppStyles"; |
|
|
import finalPropsSelectorFactory from "react-redux/es/connect/selectorFactory"; |
|
|
import Fade from "./Fade"; |
|
|
|
|
|
|
|
|
function ScrollingPicker(props) { |
|
|
function ScrollingPicker(props) { |
|
|
const scrollX = useRef(new Animated.Value(0)).current; |
|
|
const scrollX = useRef(new Animated.Value(0)).current; |
|
|
const [selected, setSelected] = useState(0); |
|
|
|
|
|
|
|
|
|
|
|
function onScroll(event){ |
|
|
function onScroll(event){ |
|
|
if (event.nativeEvent.contentOffset.x === 0) { |
|
|
if (event.nativeEvent.contentOffset.x === 0) { |
|
@ -40,18 +39,22 @@ function ScrollingPicker(props) { |
|
|
onScroll={onScroll} |
|
|
onScroll={onScroll} |
|
|
scrollEventThrottle={0} |
|
|
scrollEventThrottle={0} |
|
|
> |
|
|
> |
|
|
|
|
|
<Fade faded={props.mode !== 0} duration={250}> |
|
|
<MaterialIcon |
|
|
<MaterialIcon |
|
|
name={Icons.squareIcons.square} |
|
|
name={Icons.squareIcons.square} |
|
|
color={Colors.material.dark} |
|
|
color={Colors.material.dark} |
|
|
size={Metrics.icons.buttonIcon} |
|
|
size={Metrics.icons.buttonIcon} |
|
|
style={styles.modePickerMargin} |
|
|
style={styles.modePickerMargin} |
|
|
/> |
|
|
/> |
|
|
|
|
|
</Fade> |
|
|
|
|
|
<Fade faded={props.mode !== 1} duration={250}> |
|
|
<MaterialIcon |
|
|
<MaterialIcon |
|
|
name={Icons.squareIcons.plus} |
|
|
name={Icons.squareIcons.plus} |
|
|
color={Colors.material.dark} |
|
|
color={Colors.material.dark} |
|
|
size={Metrics.icons.buttonIcon} |
|
|
size={Metrics.icons.buttonIcon} |
|
|
style={styles.modePickerMargin} |
|
|
style={styles.modePickerMargin} |
|
|
/> |
|
|
/> |
|
|
|
|
|
</Fade> |
|
|
</ScrollView> |
|
|
</ScrollView> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|