|
@@ -1,24 +1,48 @@
|
|
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 extends BaseSystem{
|
|
|
|
|
|
-export default class Environment {
|
|
|
|
|
|
|
|
constructor(CS, phoneRef) {
|
|
constructor(CS, phoneRef) {
|
|
|
|
+ super()
|
|
this.phoneRef = phoneRef;
|
|
this.phoneRef = phoneRef;
|
|
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() {
|
|
let CurrentView = this.CoreSystem.getCurrentView();
|
|
let CurrentView = this.CoreSystem.getCurrentView();
|
|
let defaultContainer = CurrentView.getDefaultContainer();
|
|
let defaultContainer = CurrentView.getDefaultContainer();
|
|
let Rows = CurrentView.getRows(defaultContainer);
|
|
let Rows = CurrentView.getRows(defaultContainer);
|
|
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>Colasdasdasdasdasd</Text>
|
|
<Text>Colasdasdasdasdasd</Text>
|
|
{Rows.map((row) => {
|
|
{Rows.map((row) => {
|
|
@@ -34,8 +58,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>
|
|
@@ -66,5 +98,10 @@ const styles = StyleSheet.create({
|
|
col: {
|
|
col: {
|
|
flexDirection: "column",
|
|
flexDirection: "column",
|
|
borderWidth: 1
|
|
borderWidth: 1
|
|
|
|
+ },
|
|
|
|
+ button:{
|
|
|
|
+ flex:1,
|
|
|
|
+ justifyContent:'center',
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|