index.js 2.26 KB
Newer Older
李彥志's avatar
李彥志 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
import React ,{ Component } from 'react';
import {
  StyleSheet,
  View,
  Text,
  Button,
  Dimensions,
  Switch,
  Image,
  TouchableOpacity
} from 'react-native';
import styles from './styles';

class dataSync extends Component {

    static navigationOptions = ({ navigation }) => ({
      headerLeft: (
        <TouchableOpacity
          style={styles.nav_left_touch_container}
          onPress={() => {
            navigation.goBack();
          }}
        >
          <View style={styles.nav_left_icon_container}>
            <Image
              style={styles.nav_icon}
              source={require('../../images/btn_nv_back.png')}
            />
          </View>
        </TouchableOpacity>
      ),
        headerTitle: 
        <View style={styles.headerTitleContainer}>
        <Text style={styles.headerTitleTxt}>數據同步</Text>
        </View>
      });

    constructor(props) {
        super(props);
        this.state = {
          isBlocking: false
        };
        this.onChange = this.onChange.bind(this);
      }
      
      onChange(value) { 
        const { isBlocking } = this.state;
        this.setState({ value : !value  });
      }

    render() {
        return (
            <View>
                <View style={styles.subRowContainer} />
                <View style={styles.rowBackground}>
                <View style={styles.rowContainer}>
            <View>
                <Text style={styles.rowText}> 健康數據同步 </Text>
            </View>
                <View style={styles.rowContent}>
        <Switch
          value={!this.state.value}
          onValueChange={isSync => this.onChange(isSync)}
          trackColor={{ false: '#E5E5E5', true: '#339FAF' }}
          style={{ transform: [{ scaleX: 0.8 }, { scaleY: 0.8 }] }}
        />
                </View>
                </View>
                </View>
            <View style={styles.webViewContainer}>
            <Text style={styles.sub}>HRB會將本設備中第三方提供之健康數據,包含活動、心率、血壓和睡眠等資料同步至HRB,透過收集到的數據進行分析,以圖表的方式呈現,並適時的給予相關的叮嚀與提醒。
            </Text>
            </View> 
          </View>

            
            
        )

    }
};

export default dataSync;