| 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:sky/mojo/activity.dart' as activity; | 7 import 'package:sky/mojo/activity.dart' as activity; |
| 8 import 'package:sky/mojo/asset_bundle.dart'; | 8 import 'package:sky/mojo/asset_bundle.dart'; |
| 9 import 'package:sky/mojo/shell.dart' as shell; | 9 import 'package:sky/mojo/shell.dart' as shell; |
| 10 import 'package:sky/painting/box_painter.dart'; | 10 import 'package:sky/painting/box_painter.dart'; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 AssetBundle _initBundle() { | 23 AssetBundle _initBundle() { |
| 24 if (rootBundle != null) | 24 if (rootBundle != null) |
| 25 return rootBundle; | 25 return rootBundle; |
| 26 const String _kAssetBase = '..'; | 26 const String _kAssetBase = '..'; |
| 27 return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase)); | 27 return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase)); |
| 28 } | 28 } |
| 29 | 29 |
| 30 final AssetBundle _bundle = _initBundle(); | 30 final AssetBundle _bundle = _initBundle(); |
| 31 | 31 |
| 32 void launch(String relativeUrl, String bundle) { | 32 void launch(String relativeUrl, String bundle) { |
| 33 Uri url = Uri.base.resolve(relativeUrl); | 33 // TODO(eseidel): This is a hack to keep non-skyx examples working for now: |
| 34 Uri productionBase = Uri.parse( |
| 35 'https://domokit.github.io/example/demo_launcher/lib/main.dart'); |
| 36 Uri base = rootBundle == null ? Uri.base : productionBase; |
| 37 Uri url = base.resolve(relativeUrl); |
| 34 | 38 |
| 35 activity.ComponentName component = new activity.ComponentName() | 39 activity.ComponentName component = new activity.ComponentName() |
| 36 ..packageName = 'org.domokit.sky.demo' | 40 ..packageName = 'org.domokit.sky.demo' |
| 37 ..className = 'org.domokit.sky.demo.SkyDemoActivity'; | 41 ..className = 'org.domokit.sky.demo.SkyDemoActivity'; |
| 38 activity.Intent intent = new activity.Intent() | 42 activity.Intent intent = new activity.Intent() |
| 39 ..action = 'android.intent.action.VIEW' | 43 ..action = 'android.intent.action.VIEW' |
| 40 ..component = component | 44 ..component = component |
| 41 ..flags = activity.MULTIPLE_TASK | activity.NEW_DOCUMENT | 45 ..flags = activity.MULTIPLE_TASK | activity.NEW_DOCUMENT |
| 42 ..url = url.toString(); | 46 ..url = url.toString(); |
| 43 | 47 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 ) | 192 ) |
| 189 ) | 193 ) |
| 190 ) | 194 ) |
| 191 ); | 195 ); |
| 192 } | 196 } |
| 193 } | 197 } |
| 194 | 198 |
| 195 void main() { | 199 void main() { |
| 196 runApp(new SkyHome()); | 200 runApp(new SkyHome()); |
| 197 } | 201 } |
| OLD | NEW |