Skip to content

Commit ded9bb3

Browse files
authored
improve the design of Wear OS example (#16)
1 parent 169e42a commit ded9bb3

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

watch-example/src/App.tsx

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState } from 'react';
22

3-
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
3+
import { StyleSheet, View, Text, TouchableOpacity, Button } from 'react-native';
44
import { sendMessage, watchEvents } from 'react-native-wear-connectivity';
55
import type {
66
ReplyCallback,
@@ -29,8 +29,12 @@ export default function App() {
2929

3030
return (
3131
<View style={styles.container}>
32-
<Text>count is: {count}</Text>
33-
<TouchableOpacity onPress={sendMessageToPhone} style={styles.button} />
32+
<View style={styles.textBackground}>
33+
<Text style={styles.count}>The count is {count}</Text>
34+
</View>
35+
<View style={styles.buttonContainer}>
36+
<Button title="press" color="#B4B1B3" onPress={sendMessageToPhone} />
37+
</View>
3438
</View>
3539
);
3640
}
@@ -40,18 +44,33 @@ const styles = StyleSheet.create({
4044
flex: 1,
4145
alignItems: 'center',
4246
justifyContent: 'center',
43-
backgroundColor: 'yellow',
47+
backgroundColor: '#FDFDFD',
48+
},
49+
buttonContainer: {
50+
marginTop: 30,
4451
},
4552
box: {
4653
width: 60,
4754
height: 60,
4855
marginVertical: 20,
4956
},
50-
button: {
51-
marginTop: 50,
52-
height: 50,
53-
width: 50,
54-
backgroundColor: 'red',
55-
borderRadius: 50,
57+
count: {
58+
borderRadius: 3,
59+
padding: 5,
60+
backgroundColor: '#9C9A9D',
61+
textAlign: 'center',
62+
textAlignVertical: 'center',
63+
marginTop: 20,
64+
color: 'white',
65+
fontSize: 20,
66+
fontWeight: '500',
67+
},
68+
plusIcon: {
69+
flex: 1,
70+
color: 'white',
71+
textAlign: 'center',
72+
textAlignVertical: 'center',
73+
fontSize: 30,
74+
fontWeight: '400',
5675
},
5776
});

0 commit comments

Comments
 (0)