Commit 94ea193e authored by Malsha Jayakody's avatar Malsha Jayakody

add scroll views

parent 248bc388
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
Alert, Alert,
Button, Button,
ImageBackground, ImageBackground,
ScrollView,
} from 'react-native'; } from 'react-native';
import {IMGS, ROUTES, COLORS} from '../../../../constants'; import {IMGS, ROUTES, COLORS} from '../../../../constants';
import Sound from 'react-native-sound'; import Sound from 'react-native-sound';
...@@ -260,6 +261,9 @@ const CandyCrushGameLevel04 = ({navigation}) => { ...@@ -260,6 +261,9 @@ const CandyCrushGameLevel04 = ({navigation}) => {
} }
return ( return (
<ScrollView
style={styles.scrollContainer}
contentContainerStyle={styles.contentContainer}>
<ImageBackground <ImageBackground
source={IMGS.game_img_7} source={IMGS.game_img_7}
style={styles.backgroundImage} style={styles.backgroundImage}
...@@ -275,7 +279,6 @@ const CandyCrushGameLevel04 = ({navigation}) => { ...@@ -275,7 +279,6 @@ const CandyCrushGameLevel04 = ({navigation}) => {
alignItems: 'center', alignItems: 'center',
borderRadius: 14, borderRadius: 14,
width: 50, width: 50,
marginTop: 10,
}} }}
onPress={toggleMute}> onPress={toggleMute}>
<Text <Text
...@@ -329,7 +332,7 @@ const CandyCrushGameLevel04 = ({navigation}) => { ...@@ -329,7 +332,7 @@ const CandyCrushGameLevel04 = ({navigation}) => {
style={{ style={{
backgroundColor: '#702963', backgroundColor: '#702963',
height: 50, height: 50,
marginBottom: 120, marginBottom: 60,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
// marginHorizontal: 25, // marginHorizontal: 25,
...@@ -351,6 +354,7 @@ const CandyCrushGameLevel04 = ({navigation}) => { ...@@ -351,6 +354,7 @@ const CandyCrushGameLevel04 = ({navigation}) => {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</ImageBackground> </ImageBackground>
</ScrollView>
); );
}; };
...@@ -389,6 +393,12 @@ const styles = StyleSheet.create({ ...@@ -389,6 +393,12 @@ const styles = StyleSheet.create({
candyText: { candyText: {
fontSize: 30, fontSize: 30,
}, },
scrollContainer: {
flexGrow: 1,
},
contentContainer: {
paddingBottom: 40, // Adds padding at the bottom
},
}); });
export default CandyCrushGameLevel04; export default CandyCrushGameLevel04;
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
Alert, Alert,
Button, Button,
ImageBackground, ImageBackground,
ScrollView,
} from 'react-native'; } from 'react-native';
import {IMGS, ROUTES, COLORS} from '../../../../constants'; import {IMGS, ROUTES, COLORS} from '../../../../constants';
import Sound from 'react-native-sound'; import Sound from 'react-native-sound';
...@@ -215,6 +216,9 @@ const CandyCrushGameLevel03 = ({navigation}) => { ...@@ -215,6 +216,9 @@ const CandyCrushGameLevel03 = ({navigation}) => {
return true; // Matches were found and cleared return true; // Matches were found and cleared
} }
return ( return (
<ScrollView
style={styles.scrollContainer}
contentContainerStyle={styles.contentContainer}>
<ImageBackground <ImageBackground
source={IMGS.game_img_8} source={IMGS.game_img_8}
style={styles.backgroundImage} style={styles.backgroundImage}
...@@ -286,6 +290,7 @@ const CandyCrushGameLevel03 = ({navigation}) => { ...@@ -286,6 +290,7 @@ const CandyCrushGameLevel03 = ({navigation}) => {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</ImageBackground> </ImageBackground>
</ScrollView>
); );
}; };
...@@ -323,6 +328,12 @@ const styles = StyleSheet.create({ ...@@ -323,6 +328,12 @@ const styles = StyleSheet.create({
candyText: { candyText: {
fontSize: 30, fontSize: 30,
}, },
scrollContainer: {
flexGrow: 1,
},
contentContainer: {
paddingBottom: 40, // Adds padding at the bottom
},
}); });
export default CandyCrushGameLevel03; export default CandyCrushGameLevel03;
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
Image, Image,
StyleSheet, StyleSheet,
Alert, Alert,
ScrollView,
ImageBackground, ImageBackground,
} from 'react-native'; } from 'react-native';
import {IMGS, COLORS, ROUTES} from '../../../../constants'; import {IMGS, COLORS, ROUTES} from '../../../../constants';
...@@ -119,6 +120,9 @@ const GameLevel5 = ({navigation}) => { ...@@ -119,6 +120,9 @@ const GameLevel5 = ({navigation}) => {
}; };
return ( return (
<ScrollView
style={styles.scrollContainer}
contentContainerStyle={styles.contentContainer}>
<ImageBackground <ImageBackground
source={IMGS.game_img_9} source={IMGS.game_img_9}
style={styles.backgroundImage} style={styles.backgroundImage}
...@@ -199,6 +203,7 @@ const GameLevel5 = ({navigation}) => { ...@@ -199,6 +203,7 @@ const GameLevel5 = ({navigation}) => {
</View> </View>
</View> </View>
</ImageBackground> </ImageBackground>
</ScrollView>
); );
}; };
...@@ -308,6 +313,12 @@ const styles = StyleSheet.create({ ...@@ -308,6 +313,12 @@ const styles = StyleSheet.create({
height: 100, height: 100,
borderRadius: 30, borderRadius: 30,
}, },
scrollContainer: {
flexGrow: 1,
},
contentContainer: {
paddingBottom: 40, // Adds padding at the bottom
},
}); });
export default GameLevel5; export default GameLevel5;
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
StyleSheet, StyleSheet,
Alert, Alert,
ImageBackground, ImageBackground,
ScrollView,
} from 'react-native'; } from 'react-native';
import {IMGS, ROUTES, COLORS} from '../../../../constants'; import {IMGS, ROUTES, COLORS} from '../../../../constants';
import Sound from 'react-native-sound'; import Sound from 'react-native-sound';
...@@ -148,6 +149,9 @@ const GameLevel6 = () => { ...@@ -148,6 +149,9 @@ const GameLevel6 = () => {
}; };
return ( return (
<ScrollView
style={styles.scrollContainer}
contentContainerStyle={styles.contentContainer}>
<ImageBackground <ImageBackground
source={IMGS.game_img_15} source={IMGS.game_img_15}
style={styles.backgroundImage} style={styles.backgroundImage}
...@@ -252,6 +256,7 @@ const GameLevel6 = () => { ...@@ -252,6 +256,7 @@ const GameLevel6 = () => {
</View> </View>
</View> </View>
</ImageBackground> </ImageBackground>
</ScrollView>
); );
}; };
...@@ -359,6 +364,12 @@ const styles = StyleSheet.create({ ...@@ -359,6 +364,12 @@ const styles = StyleSheet.create({
shadowRadius: 2, shadowRadius: 2,
elevation: 5, elevation: 5,
}, },
scrollContainer: {
flexGrow: 1,
},
contentContainer: {
paddingBottom: 40, // Adds padding at the bottom
},
}); });
export default GameLevel6; export default GameLevel6;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment