Experiment No-01 Basic Concepts of React
import React, { Component } from 'react';
import { AppRegistry, Text, View, StyleSheet, Image,
TouchableHighlight, ImageBackground } from 'react-native';
import Constants from 'expo-constants';
export default class App extends Component {
state = {
backgroundToDisplay: ['',
'[Link]
[Link]',
'[Link]
'[Link]
[Link]'],
message: ['', 'Good morning!', 'Good afternoon!', 'Good
evening!'],
index: 0,
}
morningChosen = () => {
[Link]({
index: 1
})
}
afternoonChosen = () => {
[Link]({
index: 2,
})
}
eveningChosen = () => {
[Link]({
index: 3,
})
}
render() {
return (
<View style={[Link]}>
<ImageBackground
style={[Link]}
source={[Link][[Link]]}
>
<TouchableHighlight
onPress={[Link]}
>
<View style={[Link]}>
<Text style={[Link]}>
Good morning!
</Text>
</View>
</TouchableHighlight>
<TouchableHighlight
onPress={[Link]}
>
<View style={[Link]}>
<Text style={[Link]}>
Good afternoon!
</Text>
</View>
</TouchableHighlight>
<TouchableHighlight
onPress={[Link]}
>
<View style={[Link]}>
<Text style={[Link]}>
Good evening!
</Text>
</View>
</TouchableHighlight>
<View>
<Text style={[Link]}>
{[Link][[Link]]}
</Text>
</View>
</ImageBackground>
</View>
);
}
}
const styles = [Link]({
container: {
flex: 1,
},
background: {
flex: 1,
},
buttonView: {
height: 30,
width: 100,
backgroundColor: 'black',
justifyContent: 'center',
marginBottom: 3,
},
buttonText: {
fontSize: 10,
color: 'white',
textAlign: 'center',
},
messageText: {
fontSize: 30,
color: 'white',
textAlign: 'center'
}
});
Experiment No-02 Calculator App
import * as React from 'react';
import {
Text,
View,
StyleSheet,
Button,
TextInput,
TouchableOpacity,
Image,ExpoFont
} from 'react-native';
import * as Speech from 'expo-speech';
import { Header } from 'react-native-elements';
import logo from './assets/[Link]'
export default class App extends [Link] {
constructor() {
super();
[Link] = {
name: '',
};
}
speak = () => {
var thingToSay = [Link];
[Link] === ''
? alert('Please Enter a Word 😐')
: [Link](thingToSay);
};
render() {
return (
<View style={styles.textContainer1}>
<Header
backgroundColor={"#9CE47C"}
centerComponent={{
text: "Text To Speech Converter",
style: { color: "black", fontSize: 15, fontWeight: 700 },
}}
/>
<Image style={[Link]} source={logo} />
<Text style={styles.text2}> Enter The Word </Text>
<TextInput
style={[Link]}
onChangeText={(text) => {
[Link]({ name: text });
}}
value={[Link]}
/>
<View>
<TouchableOpacity style={[Link]} onPress={[Link]}>
<Text style={styles.text2}> Tap To Hear Speech 🗣 </Text>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = [Link]({
inputBox: {
marginTop: 20,
width: "80%",
alignSelf: "center",
height: 40,
textAlign: "center",
borderWidth: 4,
},
textContainer1: {
backgroundColor: "#FFFFFF",
justifyContent: "center",
},
text2: {
color: "black",
fontSize: 20,
marginTop: 5,
textAlign: "center",
alignSelf: "center",
fontWeight: "bold",
},
button: {
padding: 20,
fontSize: 20,
textAlign: "center",
backgroundColor: "#9CE47C",
marginTop: 80,
borderRadius: 50,
width: "80%",
alignSelf: "center",
height: 80,
},
imageIcon: {
width: 150,
height: 150,
marginTop: 20,
marginLeft: "25%",
},
});
Experiment No-03 Text to Speech App
import * as React from 'react';
import {
Text,
View,
StyleSheet,
Button,
TextInput,
TouchableOpacity,
Image,ExpoFont
} from 'react-native';
import * as Speech from 'expo-speech';
import { Header } from 'react-native-elements';
import logo from './assets/[Link]'
export default class App extends [Link] {
constructor() {
super();
[Link] = {
name: '',
};
}
speak = () => {
var thingToSay = [Link];
[Link] === ''
? alert('Please Enter a Word 😐')
: [Link](thingToSay);
};
render() {
return (
<View style={styles.textContainer1}>
<Header
backgroundColor={"#9CE47C"}
centerComponent={{
text: "Text To Speech Converter",
style: { color: "black", fontSize: 15, fontWeight: 700 },
}}
/>
<Image style={[Link]} source={logo} />
<Text style={styles.text2}> Enter The Word </Text>
<TextInput
style={[Link]}
onChangeText={(text) => {
[Link]({ name: text });
}}
value={[Link]}
/>
<View>
<TouchableOpacity style={[Link]} onPress={[Link]}>
<Text style={styles.text2}> Tap To Hear Speech 🗣 </Text>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = [Link]({
inputBox: {
marginTop: 20,
width: "80%",
alignSelf: "center",
height: 40,
textAlign: "center",
borderWidth: 4,
},
textContainer1: {
backgroundColor: "#FFFFFF",
justifyContent: "center",
},
text2: {
color: "black",
fontSize: 20,
marginTop: 5,
textAlign: "center",
alignSelf: "center",
fontWeight: "bold",
},
button: {
padding: 20,
fontSize: 20,
textAlign: "center",
backgroundColor: "#9CE47C",
marginTop: 80,
borderRadius: 50,
width: "80%",
alignSelf: "center",
height: 80,
},
imageIcon: {
width: 150,
height: 150,
marginTop: 20,
marginLeft: "25%",
},
});