parent
2179b63abe
commit
26c032c6fb
1 changed files with 0 additions and 74 deletions
|
@ -1,74 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
} from 'react-native-elements';
|
|
||||||
import {
|
|
||||||
View,
|
|
||||||
Text,
|
|
||||||
} from 'react-native';
|
|
||||||
// play,pause,stop icons
|
|
||||||
import { AntDesign } from '@expo/vector-icons';
|
|
||||||
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
||||||
import axios from 'axios'; // Took a while to figure out how to use it, but its simpler then the
|
|
||||||
|
|
||||||
function bp(name) {
|
|
||||||
// Button press handler important
|
|
||||||
axios.get('http://192.168.1.158:8080/'+name)
|
|
||||||
.then(res => {
|
|
||||||
// We don't care fore now
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
class HomeScreen extends React.Component {
|
|
||||||
static navigationOptions = ({ navigation }) => {
|
|
||||||
return {
|
|
||||||
title: navigation.getParam('otherParam', 'RPI Media Center Control'),
|
|
||||||
headerStyle: {
|
|
||||||
backgroundColor: '#3333ff',
|
|
||||||
},
|
|
||||||
headerTintColor: '#fff',
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
|
|
||||||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center'}}>
|
|
||||||
<Text>Controls</Text>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
title="Select file to play" type="outline"
|
|
||||||
onPress={() => this.props.navigation.navigate('Files')}
|
|
||||||
/><Text>{"\n"}</Text>
|
|
||||||
|
|
||||||
<View style={{flexDirection: 'row' }}>
|
|
||||||
<Button
|
|
||||||
icon={<AntDesign name="pausecircleo" size={24} color="black" />} title="Pause" type="outline"
|
|
||||||
onPress = {() => bp('pause/')}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
icon={<AntDesign name="playcircleo" size={24} color="black" />} title="Resume" type="outline"
|
|
||||||
onPress = {() => bp('resume/')}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
icon={<MaterialCommunityIcons name="stop-circle-outline" size={24} color="black" />} title="Stop" type="outline"
|
|
||||||
onPress = {() => bp('stop/')}
|
|
||||||
/><Text>{"\n"}</Text>
|
|
||||||
</View>
|
|
||||||
<Text>{"\n"}</Text>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
title="Settings" type="outline"
|
|
||||||
onPress={() => this.props.navigation.navigate('Settings')}
|
|
||||||
/><Text>{"\n"}</Text>
|
|
||||||
<Button
|
|
||||||
title="About" type="outline"
|
|
||||||
onPress={() => this.props.navigation.navigate('About')}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeScreen;
|
|
Loading…
Add table
Add a link
Reference in a new issue