OLD | NEW |
1 <script> | 1 <script> |
2 import 'dart:sky'; | 2 import 'dart:sky'; |
3 import 'package:mojom/sensors/sensors.mojom.dart'; | 3 import 'package:mojom/sensors/sensors.mojom.dart'; |
4 import 'package:sky/framework/shell.dart' as shell; | 4 import 'package:sky/framework/shell.dart' as shell; |
5 | 5 |
6 // TODO(abarth): We should factor this out into a kinematics library. | 6 // TODO(abarth): We should factor this out into a kinematics library. |
7 class _ShakeDetector implements SensorListener { | 7 class _ShakeDetector implements SensorListener { |
8 _ShakeDetector() { | 8 _ShakeDetector() { |
9 SensorServiceProxy sensorService = new SensorServiceProxy.unbound(); | 9 SensorServiceProxy sensorService = new SensorServiceProxy.unbound(); |
10 shell.requestService("mojo:sensors", sensorService); | 10 shell.requestService("mojo:sensors", sensorService); |
(...skipping 21 matching lines...) Expand all Loading... |
32 bool isShaking = false; | 32 bool isShaking = false; |
33 SensorListenerStub _stub; | 33 SensorListenerStub _stub; |
34 } | 34 } |
35 | 35 |
36 _ShakeDetector _detector; | 36 _ShakeDetector _detector; |
37 | 37 |
38 void _init(_) { | 38 void _init(_) { |
39 _detector = new _ShakeDetector(); | 39 _detector = new _ShakeDetector(); |
40 } | 40 } |
41 </script> | 41 </script> |
OLD | NEW |