|
|
@ -1,5 +1,5 @@ |
|
|
|
import React from "react" |
|
|
|
import { View, ScrollView, StyleSheet, StatusBar, Text, CheckBox, SafeAreaView, Dimensions, Image, ImageBackground, BackHandler, AsyncStorage} from "react-native" |
|
|
|
import { View, ScrollView, StyleSheet, StatusBar, Text, CheckBox, Switch, SafeAreaView, Dimensions, Image, ImageBackground, BackHandler, AsyncStorage} from "react-native" |
|
|
|
|
|
|
|
import { Button, ButtonContainer } from "../components/Button" |
|
|
|
import { colors, texts, examScheme, resultsScheme} from "../components/Variables" |
|
|
@ -123,20 +123,25 @@ const styles = StyleSheet.create({ |
|
|
|
fontWeight: "600" |
|
|
|
}, |
|
|
|
|
|
|
|
checkboxContainer: { |
|
|
|
switchContainer: { |
|
|
|
flexDirection: "row", |
|
|
|
paddingBottom: 10, |
|
|
|
marginBottom: 10, |
|
|
|
borderBottomColor: colors.black_alpha, |
|
|
|
borderBottomWidth: 1, |
|
|
|
}, |
|
|
|
checkbox: { |
|
|
|
alignSelf: "center", |
|
|
|
color: "white" |
|
|
|
switch: { |
|
|
|
alignSelf: "flex-start", |
|
|
|
color: "white", |
|
|
|
marginRight: 0, |
|
|
|
marginLeft: "auto" |
|
|
|
}, |
|
|
|
checkboxLabel: { |
|
|
|
switchLabel: { |
|
|
|
fontSize: 16, |
|
|
|
fontWeight: "600", |
|
|
|
marginLeft: 8, |
|
|
|
marginRight: 8 |
|
|
|
marginRight: 8, |
|
|
|
width: "75%" |
|
|
|
}, |
|
|
|
button: { |
|
|
|
marginTop: 20 |
|
|
@ -159,7 +164,7 @@ class Setup extends React.Component { |
|
|
|
if(!value) { |
|
|
|
setupData = { |
|
|
|
randomQuestions: true, |
|
|
|
excludeDelta: false |
|
|
|
excludeDelta: true |
|
|
|
} |
|
|
|
AsyncStorage.setItem('setupData', JSON.stringify(setupData)) |
|
|
|
} else { |
|
|
@ -205,7 +210,7 @@ class Setup extends React.Component { |
|
|
|
} |
|
|
|
|
|
|
|
changeSetup = (item) => { |
|
|
|
setupData = this.state.setupData |
|
|
|
let setupData = this.state.setupData |
|
|
|
setupData[item] = !this.state.setupData[item] |
|
|
|
|
|
|
|
this.setState( (state) => { |
|
|
@ -233,22 +238,22 @@ class Setup extends React.Component { |
|
|
|
|
|
|
|
<View style={styles.textSmall}> |
|
|
|
|
|
|
|
<View style={styles.checkboxContainer}> |
|
|
|
<CheckBox |
|
|
|
<View style={styles.switchContainer}> |
|
|
|
<Text style={styles.switchLabel}>{texts.setupRandomCheck}</Text> |
|
|
|
<Switch |
|
|
|
value={this.state.setupData.randomQuestions} |
|
|
|
onValueChange={() => this.changeSetup('randomQuestions')} |
|
|
|
style={styles.checkbox} |
|
|
|
style={styles.switch} |
|
|
|
/> |
|
|
|
<Text style={styles.checkboxLabel}>{texts.setupRandomCheck}</Text> |
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={[styles.checkboxContainer, styles.noBorder]}> |
|
|
|
<CheckBox |
|
|
|
<View style={[styles.switchContainer, styles.noBorder]}> |
|
|
|
<Text style={styles.switchLabel}>{texts.setupExcludeDelta}</Text> |
|
|
|
<Switch |
|
|
|
value={this.state.setupData.excludeDelta} |
|
|
|
onValueChange={() => this.changeSetup('excludeDelta')} |
|
|
|
style={styles.checkbox} |
|
|
|
style={styles.switch} |
|
|
|
/> |
|
|
|
<Text style={styles.checkboxLabel}>{texts.setupExcludeDelta}</Text> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|