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 { 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")
@ -14,7 +14,7 @@ const styles = StyleSheet.create({
alignItems: "center",
justifyContent: "center",
marginTop: 20,
height: 150,
height: 100,
width: "100%"
}
})
@ -26,7 +26,7 @@ export const Banner = () => {
if(__DEV__) {
banner = <Text>DEV BANNER</Text>
} else {
banner = <BannerAd size={BannerAdSize.ADAPTIVE_BANNER} unitId={adUnitId} />
banner = <BannerAd size={BannerAdSize.LARGE_BANNER} unitId={adUnitId} />
}
return (
<View style={styles.container}>

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

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

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

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

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

@ -66,10 +66,10 @@ const styles = StyleSheet.create({
textSmall: {
lineHeight: 23,
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,
color: colors.white,
fontWeight: "400",
@ -104,6 +104,7 @@ const styles = StyleSheet.create({
paddingVertical: 0,
},
textLabel: {
fontSize: 20,
paddingHorizontal: 20,
paddingVertical: 20
},
@ -149,19 +150,10 @@ class Info extends React.Component {
<SafeAreaView style={styles.safearea}>
<ScrollView>
<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.textLabel}>{`${texts.version}: ${pkg.expo.version}`}</Text>
</Text>
{/*
<Text style={styles.text}>
<Text style={styles.textLabel}>{`${texts.author}: Dslak`}</Text>
</Text>
*/}
<Text style={styles.textSmall}>
{texts.description}
</Text>
@ -199,6 +191,7 @@ class Info extends React.Component {
subtitle={texts.pdfLinkText}
isBig={false}
hasBg={true}
noBorder={true}
onPress={() => this.openURL(texts.pdfLink)}
/>
<Text></Text>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4
vds-app/app.json

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

2
vds-app/package.json

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

Loading…
Cancel
Save