|
@ -1,8 +1,9 @@ |
|
|
import React from "react" |
|
|
import React from "react" |
|
|
import { View, ScrollView, StyleSheet, StatusBar, Text, SafeAreaView, ImageBackground, BackHandler } from "react-native" |
|
|
import { View, ScrollView, StyleSheet, StatusBar, Text, SafeAreaView, ImageBackground, BackHandler } from "react-native" |
|
|
|
|
|
import { AdMobBanner } from "expo-ads-admob" |
|
|
|
|
|
|
|
|
import { Button, ButtonContainer } from "../components/Button" |
|
|
import { Button, ButtonContainer } from "../components/Button" |
|
|
import { colors } from "../components/Variables" |
|
|
|
|
|
|
|
|
import { colors, credentials } from "../components/Variables" |
|
|
|
|
|
|
|
|
const bgImage = require("../assets/bg.jpg") |
|
|
const bgImage = require("../assets/bg.jpg") |
|
|
|
|
|
|
|
@ -26,6 +27,16 @@ const styles = StyleSheet.create({ |
|
|
bg: { |
|
|
bg: { |
|
|
width: "100%", |
|
|
width: "100%", |
|
|
height: "100%" |
|
|
height: "100%" |
|
|
|
|
|
}, |
|
|
|
|
|
bannerContainer: { |
|
|
|
|
|
flex: 1, |
|
|
|
|
|
alignItems: "center", |
|
|
|
|
|
justifyContent: "center" |
|
|
|
|
|
}, |
|
|
|
|
|
banner: { |
|
|
|
|
|
width: 320, |
|
|
|
|
|
height: 100, |
|
|
|
|
|
marginVertical: 20 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -47,6 +58,10 @@ class Quiz extends React.Component { |
|
|
results: false |
|
|
results: false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bannerError = (e) => { |
|
|
|
|
|
console.log("Banner error (footer): ", e) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
componentDidMount() { |
|
|
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton) |
|
|
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton) |
|
|
} |
|
|
} |
|
@ -152,6 +167,14 @@ class Quiz extends React.Component { |
|
|
</Text> |
|
|
</Text> |
|
|
</SafeAreaView> |
|
|
</SafeAreaView> |
|
|
: <SafeAreaView></SafeAreaView>} |
|
|
: <SafeAreaView></SafeAreaView>} |
|
|
|
|
|
|
|
|
|
|
|
<View style={styles.bannerContainer}> |
|
|
|
|
|
<AdMobBanner |
|
|
|
|
|
style={styles.banner} |
|
|
|
|
|
bannerSize="largeBanner" |
|
|
|
|
|
adUnitID={credentials.adMobUnitIDFooter} |
|
|
|
|
|
onDidFailToReceiveAdWithError={this.bannerError} /> |
|
|
|
|
|
</View> |
|
|
</ScrollView> |
|
|
</ScrollView> |
|
|
</ImageBackground> |
|
|
</ImageBackground> |
|
|
) |
|
|
) |
|
|