Browse Source

update styles

feature/new_styles
dslak 2 years ago
parent
commit
7328c191b4
  1. 6
      vds-app/App/components/Banner.js
  2. 4
      vds-app/App/screens/Dictionary.js
  3. 5
      vds-app/App/screens/Exam.js
  4. 21
      vds-app/App/screens/Info.js
  5. 13
      vds-app/App/screens/Quiz.js
  6. 4
      vds-app/App/screens/QuizIndex.js
  7. 4
      vds-app/App/screens/Recap.js
  8. 2
      vds-app/App/screens/RecapTrueFalse.js
  9. 4
      vds-app/App/screens/Results.js
  10. 57
      vds-app/App/screens/Setup.js
  11. 31
      vds-app/App/screens/Splash.js
  12. 8
      vds-app/App/screens/TrueFalse.js
  13. 4
      vds-app/app.json
  14. 2
      vds-app/package.json

6
vds-app/App/components/Banner.js

@ -3,7 +3,7 @@ import { View, StyleSheet, StatusBar, Text, Dimensions } from "react-native"
import { colors, texts, credentials } from "./Variables" import { colors, texts, credentials } from "./Variables"
import { BannerAd, BannerAdSize, TestIds } from 'react-native-google-mobile-ads' import { BannerAd, BannerAdSize, TestIds } from 'react-native-google-mobile-ads'
const adUnitId = __DEV__ ? TestIds.INTERSTITIAL : 'ca-app-pub-4145771316565790~1876877627'
const adUnitId = __DEV__ ? TestIds.INTERSTITIAL : 'ca-app-pub-4145771316565790/1848957462'
const screen = Dimensions.get("window") const screen = Dimensions.get("window")
@ -14,7 +14,7 @@ const styles = StyleSheet.create({
alignItems: "center", alignItems: "center",
justifyContent: "center", justifyContent: "center",
marginTop: 20, marginTop: 20,
height: 150,
height: 100,
width: "100%" width: "100%"
} }
}) })
@ -26,7 +26,7 @@ export const Banner = () => {
if(__DEV__) { if(__DEV__) {
banner = <Text>DEV BANNER</Text> banner = <Text>DEV BANNER</Text>
} else { } else {
banner = <BannerAd size={BannerAdSize.ADAPTIVE_BANNER} unitId={adUnitId} />
banner = <BannerAd size={BannerAdSize.LARGE_BANNER} unitId={adUnitId} />
} }
return ( return (
<View style={styles.container}> <View style={styles.container}>

4
vds-app/App/screens/Dictionary.js

@ -20,12 +20,10 @@ const styles = StyleSheet.create({
justifyContent: "space-between", justifyContent: "space-between",
paddingHorizontal: 20 paddingHorizontal: 20
}, },
buttonContainer: { buttonContainer: {
marginHorizontal: 0, marginHorizontal: 0,
marginBottom: 20 marginBottom: 20
}, },
text: { text: {
color: colors.black, color: colors.black,
fontSize: 16, fontSize: 16,
@ -104,7 +102,7 @@ const styles = StyleSheet.create({
paddingHorizontal: 20, paddingHorizontal: 20,
paddingVertical: 10, paddingVertical: 10,
backgroundColor: colors.white, backgroundColor: colors.white,
borderRadius: 10,
borderRadius: 5,
overflow: "hidden" overflow: "hidden"
}, },
scrollView: { scrollView: {

5
vds-app/App/screens/Exam.js

@ -111,8 +111,6 @@ class Exam extends React.Component {
AsyncStorage.getItem('setupData').then((value) => { AsyncStorage.getItem('setupData').then((value) => {
let setupData = JSON.parse(value) let setupData = JSON.parse(value)
//console.log('handleBackButton setupData',setupData)
examScheme.forEach( (elem) => { examScheme.forEach( (elem) => {
let currentSection = setupData.excludeDelta ? allQuestions[elem.section].filter(item => !item.delta) : allQuestions[elem.section] let currentSection = setupData.excludeDelta ? allQuestions[elem.section].filter(item => !item.delta) : allQuestions[elem.section]
for(let i=0; i<elem.questions; i++) { for(let i=0; i<elem.questions; i++) {
@ -128,7 +126,7 @@ class Exam extends React.Component {
return true return true
})//.done()
})
} }
showResults = () => { showResults = () => {
@ -243,6 +241,7 @@ class Exam extends React.Component {
<Button <Button
key={answer.id} key={answer.id}
text={answer.text} text={answer.text}
noBorder={true}
colorize={{id: answer.id, clicked: this.state.clickedId, answered: this.state.answered, isCorrect: answer.correct}} colorize={{id: answer.id, clicked: this.state.clickedId, answered: this.state.answered, isCorrect: answer.correct}}
onPress={() => this.answer(answer.correct, answer.id, question)} onPress={() => this.answer(answer.correct, answer.id, question)}
/> />

21
vds-app/App/screens/Info.js

@ -66,10 +66,10 @@ const styles = StyleSheet.create({
textSmall: { textSmall: {
lineHeight: 23, lineHeight: 23,
marginTop: 15, marginTop: 15,
borderRadius: 10,
backgroundColor: colors.white_alpha,
borderWidth: 0,
borderColor: colors.white_alpha,
borderRadius: 5,
backgroundColor: colors.black_alpha2,
borderWidth: 1,
borderColor: colors.white_alpha2,
fontSize: 16, fontSize: 16,
color: colors.white, color: colors.white,
fontWeight: "400", fontWeight: "400",
@ -104,6 +104,7 @@ const styles = StyleSheet.create({
paddingVertical: 0, paddingVertical: 0,
}, },
textLabel: { textLabel: {
fontSize: 20,
paddingHorizontal: 20, paddingHorizontal: 20,
paddingVertical: 20 paddingVertical: 20
}, },
@ -149,19 +150,10 @@ class Info extends React.Component {
<SafeAreaView style={styles.safearea}> <SafeAreaView style={styles.safearea}>
<ScrollView> <ScrollView>
<View style={styles.box}> <View style={styles.box}>
{/*
<Text style={styles.text}>
<Text style={[styles.textLabel, styles.bold]}>{`${pkg.expo.name}`}</Text>
</Text>
*/}
<Text style={styles.text}> <Text style={styles.text}>
<Text style={styles.textLabel}>{`${texts.version}: ${pkg.expo.version}`}</Text> <Text style={styles.textLabel}>{`${texts.version}: ${pkg.expo.version}`}</Text>
</Text> </Text>
{/*
<Text style={styles.text}>
<Text style={styles.textLabel}>{`${texts.author}: Dslak`}</Text>
</Text>
*/}
<Text style={styles.textSmall}> <Text style={styles.textSmall}>
{texts.description} {texts.description}
</Text> </Text>
@ -199,6 +191,7 @@ class Info extends React.Component {
subtitle={texts.pdfLinkText} subtitle={texts.pdfLinkText}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noBorder={true}
onPress={() => this.openURL(texts.pdfLink)} onPress={() => this.openURL(texts.pdfLink)}
/> />
<Text></Text> <Text></Text>

13
vds-app/App/screens/Quiz.js

@ -52,13 +52,13 @@ const styles = StyleSheet.create({
}, },
dropdownContainer: { dropdownContainer: {
marginTop: 20, marginTop: 20,
borderRadius: 10,
borderRadius: 5,
width: "100%", width: "100%",
textAlign: "center", textAlign: "center",
backgroundColor: colors.blue
backgroundColor: colors.white_alpha2
}, },
dropdown: { dropdown: {
color: colors.white,
color: colors.black,
fontSize: 16, fontSize: 16,
width: "100%", width: "100%",
textAlign: "center", textAlign: "center",
@ -118,12 +118,6 @@ class Quiz extends React.Component {
}) })
} }
/*
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton)
}
*/
handleBackButton = () => { handleBackButton = () => {
this.props.navigation.navigate("Splash") this.props.navigation.navigate("Splash")
return true return true
@ -228,6 +222,7 @@ class Quiz extends React.Component {
<Button <Button
key={answer.id} key={answer.id}
text={answer.text} text={answer.text}
noBorder={true}
colorize={{id: answer.id, clicked: this.state.clickedId, answered: this.state.answered, isCorrect: answer.correct}} colorize={{id: answer.id, clicked: this.state.clickedId, answered: this.state.answered, isCorrect: answer.correct}}
onPress={() => this.answer(answer.correct, answer.id, question)} onPress={() => this.answer(answer.correct, answer.id, question)}
/> />

4
vds-app/App/screens/QuizIndex.js

@ -54,7 +54,7 @@ class QuizIndex extends React.Component {
storeWrongAnswers: JSON.parse(value) storeWrongAnswers: JSON.parse(value)
} }
}) })
})//.done()
})
AsyncStorage.getItem('setupData').then((value) => { AsyncStorage.getItem('setupData').then((value) => {
this.setState( (state) => { this.setState( (state) => {
@ -63,7 +63,7 @@ class QuizIndex extends React.Component {
excludeDelta: JSON.parse(value).excludeDelta excludeDelta: JSON.parse(value).excludeDelta
} }
}) })
})//.done()
})
} }
componentWillUnmount() { componentWillUnmount() {

4
vds-app/App/screens/Recap.js

@ -115,7 +115,7 @@ class Recap extends React.Component {
storeWrongAnswers: JSON.parse(value) storeWrongAnswers: JSON.parse(value)
} }
}) })
})//.done()
})
} }
componentWillUnmount() { componentWillUnmount() {
@ -145,7 +145,7 @@ class Recap extends React.Component {
return true return true
})//.done()
})
} }
render() { render() {

2
vds-app/App/screens/RecapTrueFalse.js

@ -106,7 +106,7 @@ class RecapTrueFalse extends React.Component {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton) BackHandler.addEventListener('hardwareBackPress', this.handleBackButton)
AsyncStorage.getItem('storeWrongAnswers').then((value) => { AsyncStorage.getItem('storeWrongAnswers').then((value) => {
//console.log(value) //console.log(value)
})//.done()
})
} }
componentWillUnmount() { componentWillUnmount() {

4
vds-app/App/screens/Results.js

@ -141,7 +141,7 @@ class Results extends React.Component {
} }
}) })
})//.done()
})
} }
componentWillUnmount() { componentWillUnmount() {
@ -170,7 +170,7 @@ class Results extends React.Component {
return true return true
})//.done()
})
} }

57
vds-app/App/screens/Setup.js

@ -75,61 +75,39 @@ const styles = StyleSheet.create({
textShadowOffset: {width: -1, height: 1}, textShadowOffset: {width: -1, height: 1},
textShadowRadius: 5 textShadowRadius: 5
}, },
textSmall: {
switchesBox: {
lineHeight: 23, lineHeight: 23,
marginTop: 15,
borderRadius: 10,
backgroundColor: colors.white,
borderWidth: 0,
borderColor: colors.white_alpha,
fontSize: 16,
//marginTop: 15,
borderRadius: 5,
backgroundColor: colors.black_alpha2,
borderColor: colors.white,
borderWidth: 2,
fontSize: 18,
color: colors.white, color: colors.white,
fontWeight: "400", fontWeight: "400",
textAlign: "center", textAlign: "center",
paddingHorizontal: 20, paddingHorizontal: 20,
paddingVertical: 20,
paddingVertical: 5,
textShadowColor: 'rgba(0, 0, 0, 0.75)', textShadowColor: 'rgba(0, 0, 0, 0.75)',
textShadowOffset: {width: -1, height: 1}, textShadowOffset: {width: -1, height: 1},
textShadowRadius: 5 textShadowRadius: 5
}, },
textItems: {
fontSize: 16,
fontWeight: "400",
lineHeight: 23,
color: colors.white,
textAlign: "center",
paddingBottom: 10,
marginBottom: 10,
borderBottomColor: colors.white_alpha,
borderBottomWidth: 1,
textShadowColor: 'rgba(0, 0, 0, 0.55)',
textShadowOffset: {width: -1, height: 1},
textShadowRadius: 2
},
noBorder: { noBorder: {
borderBottomWidth: 0 borderBottomWidth: 0
}, },
item: {
width: "100%"
},
noPadding: { noPadding: {
paddingVertical: 0, paddingVertical: 0,
}, },
textLabel: {
paddingHorizontal: 20,
paddingVertical: 20
},
bold: { bold: {
lineHeight: 30, lineHeight: 30,
fontSize: 26, fontSize: 26,
fontWeight: "600" fontWeight: "600"
}, },
switchContainer: { switchContainer: {
flexDirection: "row", flexDirection: "row",
paddingBottom: 10,
marginBottom: 10,
borderBottomColor: colors.black_alpha,
paddingVertical: 15,
//marginVertical: 10,
borderBottomColor: colors.white,
borderBottomWidth: 1, borderBottomWidth: 1,
}, },
switch: { switch: {
@ -139,10 +117,10 @@ const styles = StyleSheet.create({
marginLeft: "auto" marginLeft: "auto"
}, },
switchLabel: { switchLabel: {
fontSize: 16,
fontSize: 18,
fontWeight: "600", fontWeight: "600",
marginLeft: 8,
marginRight: 8,
marginHorizontal: 8,
color: colors.white,
width: "75%" width: "75%"
}, },
button: { button: {
@ -178,7 +156,7 @@ class Setup extends React.Component {
setupData: setupData setupData: setupData
} }
}) })
})//.done()
})
} }
@ -207,7 +185,7 @@ class Setup extends React.Component {
return true return true
})//.done()
})
} }
@ -238,7 +216,7 @@ class Setup extends React.Component {
{texts.setupScheme} {texts.setupScheme}
</Text> </Text>
<View style={styles.textSmall}>
<View style={styles.switchesBox}>
<View style={styles.switchContainer}> <View style={styles.switchContainer}>
<Text style={styles.switchLabel}>{texts.setupRandomCheck}</Text> <Text style={styles.switchLabel}>{texts.setupRandomCheck}</Text>
@ -265,6 +243,7 @@ class Setup extends React.Component {
color={colors.white_alpha2} color={colors.white_alpha2}
hasShadow={true} hasShadow={true}
hasBg={true} hasBg={true}
noBorder={true}
text={texts.save} text={texts.save}
onPress={() => {this.handleBackButton()} onPress={() => {this.handleBackButton()}
} }

31
vds-app/App/screens/Splash.js

@ -96,8 +96,8 @@ class Splash extends React.Component {
setupData: setup ? JSON.parse(setup) : {} setupData: setup ? JSON.parse(setup) : {}
} }
}) })
})//.done()
})//.done()
})
})
} }
@ -123,8 +123,6 @@ class Splash extends React.Component {
const storeWrongAnswers = this.props.navigation.getParam("storeWrongAnswers") || this.state.storeWrongAnswers const storeWrongAnswers = this.props.navigation.getParam("storeWrongAnswers") || this.state.storeWrongAnswers
//console.log(storeWrongAnswers.length)
if(this.state.timer==maxTime) { if(this.state.timer==maxTime) {
interval = setInterval( () => { interval = setInterval( () => {
this.setState( (state) => { this.setState( (state) => {
@ -154,14 +152,15 @@ class Splash extends React.Component {
<SafeAreaView style={styles.safearea}> <SafeAreaView style={styles.safearea}>
<View> <View>
<ButtonContainer isBoxed={true}>
<ButtonContainer isBoxed={false}>
<Button <Button
text={texts.section_quizzes} text={texts.section_quizzes}
subtitle={`(${texts.section_quizzes_subtitle})`} subtitle={`(${texts.section_quizzes_subtitle})`}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => onPress={() =>
this.props.navigation.navigate("QuizIndex", { this.props.navigation.navigate("QuizIndex", {
@ -175,8 +174,9 @@ class Splash extends React.Component {
subtitle={`(${texts.exam_simulation})`} subtitle={`(${texts.exam_simulation})`}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => onPress={() =>
this.props.navigation.navigate("Exam", { this.props.navigation.navigate("Exam", {
@ -193,8 +193,9 @@ class Splash extends React.Component {
subtitle={`(${storeWrongAnswers.length} ${texts.wrong_title})`} subtitle={`(${storeWrongAnswers.length} ${texts.wrong_title})`}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => onPress={() =>
this.props.navigation.navigate("Quiz", { this.props.navigation.navigate("Quiz", {
@ -212,8 +213,9 @@ class Splash extends React.Component {
subtitle={`(${texts.trueFalseSubtitle})`} subtitle={`(${texts.trueFalseSubtitle})`}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => onPress={() =>
this.props.navigation.navigate("TrueFalse", { this.props.navigation.navigate("TrueFalse", {
@ -227,8 +229,9 @@ class Splash extends React.Component {
subtitle={`(${texts.dictionarySubtitle})`} subtitle={`(${texts.dictionarySubtitle})`}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => this.props.navigation.navigate("Dictionary", {})} onPress={() => this.props.navigation.navigate("Dictionary", {})}
/> />
@ -237,8 +240,9 @@ class Splash extends React.Component {
subtitle={`(${texts.setupSubtitle})`} subtitle={`(${texts.setupSubtitle})`}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => this.props.navigation.navigate("Setup", {})} onPress={() => this.props.navigation.navigate("Setup", {})}
/> />
@ -246,8 +250,9 @@ class Splash extends React.Component {
text={texts.infoTitle} text={texts.infoTitle}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true}
color={colors.white_alpha} color={colors.white_alpha}
onPress={() => this.props.navigation.navigate("Info", {})} onPress={() => this.props.navigation.navigate("Info", {})}
/> />
@ -255,7 +260,7 @@ class Splash extends React.Component {
text={texts.exit} text={texts.exit}
isBig={false} isBig={false}
hasBg={true} hasBg={true}
noPadding={true}
noPadding={false}
hasShadow={true} hasShadow={true}
noBorder={true} noBorder={true}
color={colors.white_alpha2} color={colors.white_alpha2}

8
vds-app/App/screens/TrueFalse.js

@ -52,8 +52,10 @@ const styles = StyleSheet.create({
paddingBottom: 0 paddingBottom: 0
}, },
textAnswer: { textAnswer: {
color: colors.black,
backgroundColor: colors.white,
color: colors.white,
backgroundColor: colors.black_alpha,
borderColor: colors.white,
borderWidth: 2,
fontSize: 18, fontSize: 18,
textAlign: "center", textAlign: "center",
fontWeight: "400", fontWeight: "400",
@ -227,6 +229,7 @@ class Quiz extends React.Component {
<Button <Button
halfSize={true} halfSize={true}
text={texts.true} text={texts.true}
noBorder={true}
colorize={{id: randomAnswer.id, clicked: this.state.clickedAnswer ? randomAnswer.id : false, answered: this.state.answered, isCorrect: randomAnswer.correct || false}} colorize={{id: randomAnswer.id, clicked: this.state.clickedAnswer ? randomAnswer.id : false, answered: this.state.answered, isCorrect: randomAnswer.correct || false}}
onPress={() => this.answer(true, randomAnswer.correct || false, randomAnswer.id, question)} onPress={() => this.answer(true, randomAnswer.correct || false, randomAnswer.id, question)}
/> />
@ -234,6 +237,7 @@ class Quiz extends React.Component {
<Button <Button
halfSize={true} halfSize={true}
text={texts.false} text={texts.false}
noBorder={true}
colorize={{id: randomAnswer.id, clicked: !this.state.clickedAnswer ? randomAnswer.id : false, answered: this.state.answered, isCorrect: !randomAnswer.correct}} colorize={{id: randomAnswer.id, clicked: !this.state.clickedAnswer ? randomAnswer.id : false, answered: this.state.answered, isCorrect: !randomAnswer.correct}}
onPress={() => this.answer(false, randomAnswer.correct || false, randomAnswer.id, question)} onPress={() => this.answer(false, randomAnswer.correct || false, randomAnswer.id, question)}
/> />

4
vds-app/app.json

@ -10,7 +10,7 @@
"android", "android",
"web" "web"
], ],
"version": "3.8.0",
"version": "3.8.1",
"orientation": "portrait", "orientation": "portrait",
"icon": "./assets/icon.png", "icon": "./assets/icon.png",
"splash": { "splash": {
@ -29,7 +29,7 @@
"icon": "./assets/icon.png", "icon": "./assets/icon.png",
"package": "com.dslak.vdsquiz", "package": "com.dslak.vdsquiz",
"permissions": [], "permissions": [],
"versionCode": 27
"versionCode": 28
}, },
"ios": { "ios": {
"icon": "./assets/iconIOS.png", "icon": "./assets/iconIOS.png",

2
vds-app/package.json

@ -1,6 +1,6 @@
{ {
"name": "vds-quiz", "name": "vds-quiz",
"version": "3.8.0",
"version": "3.8.1",
"license": "MIT", "license": "MIT",
"main": "node_modules/expo/AppEntry.js", "main": "node_modules/expo/AppEntry.js",
"scripts": { "scripts": {

Loading…
Cancel
Save