OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import 'dart:sky'; | 5 import 'dart:sky'; |
6 | 6 |
7 import 'package:mojom/intents/intents.mojom.dart'; | 7 import 'package:mojom/intents/intents.mojom.dart'; |
8 import 'package:sky/mojo/shell.dart' as shell; | 8 import 'package:sky/mojo/shell.dart' as shell; |
9 import 'package:sky/painting/box_painter.dart'; | 9 import 'package:sky/painting/box_painter.dart'; |
10 import 'package:sky/theme/colors.dart' as colors; | 10 import 'package:sky/theme/colors.dart' as colors; |
11 import 'package:sky/theme/edges.dart'; | 11 import 'package:sky/theme/edges.dart'; |
12 import 'package:sky/theme/typography.dart' as typography; | 12 import 'package:sky/theme/typography.dart' as typography; |
13 import 'package:sky/widgets/basic.dart'; | 13 import 'package:sky/widgets/basic.dart'; |
14 import 'package:sky/widgets/card.dart'; | 14 import 'package:sky/widgets/card.dart'; |
15 import 'package:sky/widgets/fixed_height_scrollable.dart'; | 15 import 'package:sky/widgets/fixed_height_scrollable.dart'; |
16 import 'package:sky/widgets/flat_button.dart'; | 16 import 'package:sky/widgets/flat_button.dart'; |
17 import 'package:sky/widgets/material.dart'; | 17 import 'package:sky/widgets/material.dart'; |
18 import 'package:sky/widgets/scaffold.dart'; | 18 import 'package:sky/widgets/scaffold.dart'; |
19 import 'package:sky/widgets/theme.dart'; | 19 import 'package:sky/widgets/theme.dart'; |
20 import 'package:sky/widgets/tool_bar.dart'; | 20 import 'package:sky/widgets/tool_bar.dart'; |
21 | 21 |
22 void launch(String relativeUrl) { | 22 void launch(String relativeUrl) { |
23 Uri url = Uri.base.resolve(relativeUrl); | 23 Uri url = Uri.base.resolve(relativeUrl); |
24 url = url.replace(scheme: 'sky'); | |
25 | 24 |
26 ActivityManagerProxy activityManager = new ActivityManagerProxy.unbound(); | 25 ActivityManagerProxy activityManager = new ActivityManagerProxy.unbound(); |
| 26 ComponentName component = new ComponentName() |
| 27 ..packageName = 'org.domokit.sky.demo' |
| 28 ..className = 'org.domokit.sky.demo.SkyDemoActivity'; |
27 Intent intent = new Intent() | 29 Intent intent = new Intent() |
28 ..action = 'android.intent.action.VIEW' | 30 ..action = 'android.intent.action.VIEW' |
| 31 ..component = component |
29 ..url = url.toString(); | 32 ..url = url.toString(); |
30 shell.requestService(null, activityManager); | 33 shell.requestService(null, activityManager); |
31 activityManager.ptr.startActivity(intent); | 34 activityManager.ptr.startActivity(intent); |
32 } | 35 } |
33 | 36 |
34 class SkyDemo { | 37 class SkyDemo { |
35 String name; | 38 String name; |
36 String href; | 39 String href; |
37 String description; | 40 String description; |
38 typography.TextTheme textTheme; | 41 typography.TextTheme textTheme; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 child: new DemoList() | 168 child: new DemoList() |
166 ) | 169 ) |
167 ) | 170 ) |
168 ); | 171 ); |
169 } | 172 } |
170 } | 173 } |
171 | 174 |
172 void main() { | 175 void main() { |
173 runApp(new SkyHome()); | 176 runApp(new SkyHome()); |
174 } | 177 } |
OLD | NEW |