12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- import React from 'react';
- import { Button , View, Text, StyleSheet } from 'react-native';
- import {Icon} from 'react-native-elements';
- import BaseSystem from './System';
- export default class Environment extends BaseSystem{
- constructor(CS) {
- super();
- 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() {
- return <View style={styles.container}>
- <View style={[styles.row,styles.button]}>
- <Button
- color="#D2691E"
- onPress = {() => this.addRow()}
- title={
- <Icon name='add'
- color="#606060"
- containerStyle={{height:10}}
- />}
- />
- </View>
- <View style={styles.row}>
- <View style={styles.col}>
- <Text>Col</Text>
- </View>
- <View style={[styles.mobileView, styles.col]}>
- {this.CoreSystem.render()}
- </View>
- <View style={styles.col}>
- <Text>Col</Text>
- </View>
- </View>
- <View style={[styles.row,styles.button]}>
- <Button
- color="#D2691E"
- onPress={() => this.addRow()}
- title={
- <Icon name='add'
- color="#606060"
- containerStyle={{height:10}}
- />}
- />
- </View>
- </View>
- }
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- flexDirection: "column"
- },
- mobileView: {
- backgroundColor: 'white',
- borderWidth: 4,
- borderColor: 'orange',
- flex:1,
- alignSelf: 'stretch',
- // iphone X
- width:1125/3,
- height: 2436/3
- },
- row: {
- flexDirection: "row",
- borderWidth: 1
- },
- col: {
- flexDirection: "column",
- borderWidth: 1
- },
- button:{
- flex:1,
- justifyContent:'center',
- }
- });
|