Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: sky/home.dart

Issue 1218593002: Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/home.dart
diff --git a/sky/home.dart b/sky/home.dart
deleted file mode 100644
index a5a282ca035c8b76dd0816b4c6105190e2043f20..0000000000000000000000000000000000000000
--- a/sky/home.dart
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'dart:sky';
-
-import 'package:mojom/intents/intents.mojom.dart';
-import 'package:sky/framework/shell.dart' as shell;
-import 'package:sky/theme/colors.dart' as colors;
-import 'package:sky/theme/edges.dart';
-import 'package:sky/theme/typography.dart' as typography;
-import 'package:sky/widgets/material.dart';
-import 'package:sky/widgets/raised_button.dart';
-import 'package:sky/widgets/scaffold.dart';
-import 'package:sky/widgets/tool_bar.dart';
-import 'package:sky/widgets/basic.dart';
-
-void launch(String relativeUrl) {
- Uri url = Uri.base.resolve(relativeUrl);
- url = url.replace(scheme: 'sky');
-
- ActivityManagerProxy activityManager = new ActivityManagerProxy.unbound();
- Intent intent = new Intent()
- ..action = 'android.intent.action.VIEW'
- ..url = url.toString();
- shell.requestService(null, activityManager);
- activityManager.ptr.startActivity(intent);
-}
-
-class SkyDemo extends Component {
- String text;
- String href;
-
- SkyDemo(String text, this.href) : this.text = text, super(key: text);
-
- void _handlePress() {
- launch(href);
- }
-
- Widget build() {
- return new ConstrainedBox(
- constraints: const BoxConstraints.expandWidth(),
- child: new RaisedButton(
- child: new Text(text),
- onPressed: _handlePress
- )
- );
- }
-}
-
-class SkyHome extends App {
- Widget build() {
- List<Widget> children = [
- new SkyDemo('Stocks App', 'examples/stocks2/lib/stock_app.dart'),
- new SkyDemo('Asteroids Game', 'examples/game/main.dart'),
- new SkyDemo('Interactive Flex', 'examples/rendering/interactive_flex.dart'),
- new SkyDemo('Sector Layout', 'examples/widgets/sector.dart'),
- new SkyDemo('Touch Demo', 'examples/rendering/touch_demo.dart'),
- new SkyDemo('Minedigger Game', 'examples/mine_digger/mine_digger.dart'),
-
- // TODO(eseidel): We could use to separate these groups?
- new SkyDemo('Old Stocks App', 'examples/stocks/main.sky'),
- new SkyDemo('Old Touch Demo', 'examples/raw/touch-demo.sky'),
- new SkyDemo('Old Spinning Square', 'examples/raw/spinning-square.sky'),
-
- new SkyDemo('Licences (Old)', 'LICENSES.sky'),
- ];
-
- return new Scaffold(
- toolbar: new ToolBar(
- center: new Text('Sky Demos', style: typography.white.title),
- backgroundColor: colors.Blue[500]),
- body: new Material(
- edge: MaterialEdge.canvas,
- child: new Flex(
- children,
- direction: FlexDirection.vertical,
- justifyContent: FlexJustifyContent.spaceAround
- )
- )
- );
- }
-}
-
-void main() {
- runApp(new SkyHome());
-}
« no previous file with comments | « sky/examples/widgets/tabs.dart ('k') | sky/sdk/README.md » ('j') | sky/sdk/README.md » ('J')

Powered by Google App Engine
This is Rietveld 408576698