Delete 'src/screens/SettingsScreen.js.old'
removing per notes in issue #3
This commit is contained in:
parent
26c032c6fb
commit
fc0b0dddac
1 changed files with 0 additions and 78 deletions
|
@ -1,78 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
View,
|
|
||||||
Text,
|
|
||||||
TextInput,
|
|
||||||
} from 'react-native';
|
|
||||||
import {
|
|
||||||
Header,
|
|
||||||
Button,
|
|
||||||
} from 'react-native-elements';
|
|
||||||
|
|
||||||
|
|
||||||
class SettingsScreen extends React.Component {
|
|
||||||
// 1
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
let initv = this.getMyStringValue;
|
|
||||||
this.state = { value : initv };
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
setStringValue = async (value) => {
|
|
||||||
try {
|
|
||||||
await AsyncStorage.setItem('key', value)
|
|
||||||
} catch(e) {
|
|
||||||
// save error
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log('Done.')
|
|
||||||
}
|
|
||||||
|
|
||||||
getMyStringValue = async () => {
|
|
||||||
try {
|
|
||||||
return await AsyncStorage.getItem('@key')
|
|
||||||
} catch(e) {
|
|
||||||
// read error
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log('Done.')
|
|
||||||
//this.state.value =rv;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static navigationOptions = ({ navigation }) => {
|
|
||||||
return {
|
|
||||||
title: navigation.getParam('otherParam', 'Settings'),
|
|
||||||
headerStyle: {
|
|
||||||
backgroundColor: '#3333ff',
|
|
||||||
},
|
|
||||||
headerTintColor: '#fff',
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
|
||||||
let value = this.state.value;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center'}}>
|
|
||||||
<Text>Settings Screen{"\n"}{"\n"}
|
|
||||||
RPI Media Center Control v 1.0 beta Settings{"\n"}</Text>
|
|
||||||
<Text>{"\n"}server IP/hostname: </Text>
|
|
||||||
<TextInput onChangeText={newValue => this.setStringValue(newValue)} style={{borderWidth: 1, width: 100}} >{value}</TextInput>
|
|
||||||
<Text>{"\n"}</Text>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</View>
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SettingsScreen;
|
|
Loading…
Add table
Add a link
Reference in a new issue