|
@@ -1,20 +1,43 @@
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
|
|
|
-import { View, Text, StyleSheet } from 'react-native';
|
|
|
|
|
|
+import { Button , View, Text, StyleSheet } from 'react-native';
|
|
|
|
+import {Icon} from 'react-native-elements';
|
|
|
|
+import BaseSystem from './System';
|
|
|
|
|
|
-export default class Environment {
|
|
|
|
|
|
+
|
|
|
|
+export default class Environment extends BaseSystem{
|
|
|
|
|
|
constructor(CS) {
|
|
constructor(CS) {
|
|
|
|
+ super();
|
|
this.CoreSystem = CS;
|
|
this.CoreSystem = CS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ addRow(){
|
|
|
|
+ let View = this.CoreSystem.getCurrentView();
|
|
|
|
+ let container = View.getDefaultContainer();
|
|
|
|
+ let rows = View.getRows(container);
|
|
|
|
+ View.setRows(container,rows.length + 1)
|
|
|
|
+ rows = View.getRows(container)
|
|
|
|
+ View.setColumns(rows[rows.length-1],1)
|
|
|
|
+ rows[rows.length-1].props.selected = true;
|
|
|
|
+ this.forceUpdate();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
render() {
|
|
render() {
|
|
return <View style={styles.container}>
|
|
return <View style={styles.container}>
|
|
- <View style={styles.row}>
|
|
|
|
- <Text>Row</Text>
|
|
|
|
-
|
|
|
|
|
|
+ <View style={[styles.row,styles.button]}>
|
|
|
|
+ <Button
|
|
|
|
+ color="#D2691E"
|
|
|
|
+ onPress = {() => this.addRow()}
|
|
|
|
+ title={
|
|
|
|
+ <Icon name='add'
|
|
|
|
+ color="#606060"
|
|
|
|
+ containerStyle={{height:10}}
|
|
|
|
+ />}
|
|
|
|
+ />
|
|
</View>
|
|
</View>
|
|
- <View style={styles.row}>
|
|
|
|
|
|
+ <View style={styles.row}>
|
|
<View style={styles.col}>
|
|
<View style={styles.col}>
|
|
<Text>Col</Text>
|
|
<Text>Col</Text>
|
|
</View>
|
|
</View>
|
|
@@ -25,8 +48,16 @@ export default class Environment {
|
|
<Text>Col</Text>
|
|
<Text>Col</Text>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
- <View style={styles.row}>
|
|
|
|
- <Text>row</Text>
|
|
|
|
|
|
+ <View style={[styles.row,styles.button]}>
|
|
|
|
+ <Button
|
|
|
|
+ color="#D2691E"
|
|
|
|
+ onPress={() => this.addRow()}
|
|
|
|
+ title={
|
|
|
|
+ <Icon name='add'
|
|
|
|
+ color="#606060"
|
|
|
|
+ containerStyle={{height:10}}
|
|
|
|
+ />}
|
|
|
|
+ />
|
|
|
|
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
@@ -57,5 +88,10 @@ const styles = StyleSheet.create({
|
|
col: {
|
|
col: {
|
|
flexDirection: "column",
|
|
flexDirection: "column",
|
|
borderWidth: 1
|
|
borderWidth: 1
|
|
|
|
+ },
|
|
|
|
+ button:{
|
|
|
|
+ flex:1,
|
|
|
|
+ justifyContent:'center',
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|