This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMainView.ux
91 lines (83 loc) · 3.77 KB
/
MainView.ux
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
84
85
86
87
88
89
90
91
<App>
<iOS.StatusBarConfig IsVisible="False" />
<Panel>
<!--Optional file which exports all the values as observables-->
<JavaScript File="MotionJS.js"/>
<JavaScript>
var Motion = require("Motion");
//Subscribe to all available sensors with a delay of 200ms (0.2sec)
Motion.Subscribe("accelerometer magnetometer gyroscope motion activity", 0.2);
module.exports = {
goToValues: function() { router.goto("Values"); },
goToGravity: function() { router.goto("Gravity"); },
goToShock: function() { router.goto("Shock"); },
goToSwipe: function() { router.goto("Swipe"); },
unsubscribe: function() { Motion.Unsubscribe("accelerometer magnetometer gyroscope motion activity"); },
subscribe: function() { Motion.Subscribe("accelerometer magnetometer gyroscope motion activity", 0.2);}
};
</JavaScript>
<Router ux:Name="router" />
<DockPanel>
<PageIndicator Dock="Bottom" Alignment="Center" Margin="5" Navigation="slides">
<Circle ux:Template="DotTemplate" Width="10" Height="10" Margin="4">
<SolidColor ux:Name="dotStrokeBody" Color="#0000" />
<Stroke ux:Name="dotStroke" Width="2">
<SolidColor ux:Name="dotStrokeColor" Color="#bbb" />
</Stroke>
<ActivatingAnimation>
<Change dotStrokeBody.Color="#aaa" />
<Change dotStrokeColor.Color="#aaa" />
</ActivatingAnimation>
</Circle>
</PageIndicator>
</DockPanel>
<PageControl ux:Name="slides" ClipToBounds="true">
<Page ux:Name="Home">
<ScrollView>
<StackPanel>
<Panel Margin="25" Padding="10" Clicked="{goToValues}" Background="0, 0, 0, 0.2">
<StackPanel>
<Text Value="Values" FontSize="20" />
<Text Value="Displays all available values" />
</StackPanel>
</Panel>
<Panel Margin="25" Padding="10" Clicked="{goToGravity}" Background="0, 0, 0, 0.2">
<StackPanel>
<Text Value="Gravity" FontSize="20" />
<Text Value="Uses magnetometer to apply a gravity effect to a dropshadow" TextWrapping="Wrap"/>
</StackPanel>
</Panel>
<Panel Margin="25" Padding="10" Clicked="{goToShock}" Background="0, 0, 0, 0.2">
<StackPanel>
<Text Value="Shock" FontSize="20" />
<Text Value="Uses accelerometer to detect when the phone is hit" TextWrapping="Wrap"/>
</StackPanel>
</Panel>
<Panel Margin="25" Padding="10" Clicked="{goToSwipe}" Background="0, 0, 0, 0.2">
<StackPanel>
<Text Value="Swipe" FontSize="20"/>
<Text Value="No more phone thumb from swiping right! Train your wrist by using the gyroscope to enable a swipe like feature" TextWrapping="Wrap"/>
</StackPanel>
</Panel>
<Panel Margin="25" Padding="10" Clicked="{subscribe}" Background="0, 0, 0, 0.2">
<StackPanel>
<Text Value="Subscribe" FontSize="20"/>
<Text Value="Subscribe to sensor updates" TextWrapping="Wrap"/>
</StackPanel>
</Panel>
<Panel Margin="25, 0, 25, 25" Padding="10" Clicked="{unsubscribe}" Background="0, 0, 0, 0.2">
<StackPanel>
<Text Value="Unsubscribe" FontSize="20"/>
<Text Value="Unsubscribe from sensor updates" TextWrapping="Wrap"/>
</StackPanel>
</Panel>
</StackPanel>
</ScrollView>
</Page>
<Values ux:Name="Values"/>
<Gravity ux:Name="Gravity"/>
<Shock ux:Name="Shock"/>
<Swipe ux:Name="Swipe"/>
</PageControl>
</Panel>
</App>