diff --git a/examples/BUILD.gn b/examples/BUILD.gn index 5ead42c2f1f..01a2d5f84f5 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -6,12 +6,9 @@ group("examples") { testonly = true deps = [ - "//examples/demo_launcher", "//examples/fitness", "//examples/game", "//examples/mine_digger", - "//examples/rendering", "//examples/stocks", - "//examples/widgets", ] } diff --git a/examples/demo_launcher/BUILD.gn b/examples/demo_launcher/BUILD.gn deleted file mode 100644 index a5cd5dae673..00000000000 --- a/examples/demo_launcher/BUILD.gn +++ /dev/null @@ -1,28 +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("//sky/build/sky_app.gni") - -sky_app("demo_launcher") { - main_dart = "lib/main.dart" - manifest = "sky.yaml" - - if (is_android) { - apk_name = "SkyDemo" - - bundles = [ - "//examples/fitness", - "//examples/game", - "//examples/mine_digger", - "//examples/rendering:interactive_flex", - "//examples/stocks", - "//examples/widgets:cards", - ] - - deps = [ - "//examples/demo_launcher/apk:java", - "//examples/demo_launcher/apk:resources", - ] - } -} diff --git a/examples/demo_launcher/apk/AndroidManifest.xml b/examples/demo_launcher/apk/AndroidManifest.xml deleted file mode 100644 index ec14badc145..00000000000 --- a/examples/demo_launcher/apk/AndroidManifest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/demo_launcher/apk/BUILD.gn b/examples/demo_launcher/apk/BUILD.gn deleted file mode 100644 index ae2e77e1bad..00000000000 --- a/examples/demo_launcher/apk/BUILD.gn +++ /dev/null @@ -1,27 +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. - -assert(is_android) - -import("//build/config/android/config.gni") -import("//build/config/android/rules.gni") - -android_library("java") { - java_files = [ - "org/domokit/sky/demo/SkyDemoActivity.java", - "org/domokit/sky/demo/SkyDemoApplication.java", - ] - - deps = [ - "//base:base_java", - "//mojo/public/java:bindings", - "//mojo/public/java:system", - "//sky/shell:java", - ] -} - -android_resources("resources") { - resource_dirs = [ "res" ] - android_manifest = "AndroidManifest.xml" -} diff --git a/examples/demo_launcher/apk/README.md b/examples/demo_launcher/apk/README.md deleted file mode 100644 index 6bde0ac995d..00000000000 --- a/examples/demo_launcher/apk/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Icon image comes from: -https://openclipart.org/detail/30073/tango%20weather%20few%20clouds -and is public domain. - -Icon resources were generated using: -http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html -which produces art under CC 3.0: -http://creativecommons.org/licenses/by/3.0/ diff --git a/examples/demo_launcher/apk/org/domokit/sky/demo/SkyDemoActivity.java b/examples/demo_launcher/apk/org/domokit/sky/demo/SkyDemoActivity.java deleted file mode 100644 index ad97c69be89..00000000000 --- a/examples/demo_launcher/apk/org/domokit/sky/demo/SkyDemoActivity.java +++ /dev/null @@ -1,31 +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. - -package org.domokit.sky.demo; - -import android.content.Intent; - -import org.domokit.sky.shell.SkyActivity; - -/** - * Main activity for SkyDemo. - */ -public class SkyDemoActivity extends SkyActivity { - @Override - protected void onSkyReady() { - Intent intent = getIntent(); - String action = intent.getAction(); - - if (Intent.ACTION_VIEW.equals(action)) { - String bundleName = intent.getStringExtra("bundleName"); - if (bundleName != null && loadBundleByName(bundleName)) { - return; - } - loadUrl(intent.getDataString()); - return; - } - - super.onSkyReady(); - } -} diff --git a/examples/demo_launcher/apk/org/domokit/sky/demo/SkyDemoApplication.java b/examples/demo_launcher/apk/org/domokit/sky/demo/SkyDemoApplication.java deleted file mode 100644 index 48f8a156227..00000000000 --- a/examples/demo_launcher/apk/org/domokit/sky/demo/SkyDemoApplication.java +++ /dev/null @@ -1,30 +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. - -package org.domokit.sky.demo; - -import android.content.Context; - -import org.domokit.sky.shell.ResourceExtractor; -import org.domokit.sky.shell.SkyApplication; - -/** - * SkyDemo implementation of {@link android.app.Application} - */ -public class SkyDemoApplication extends SkyApplication { - private static final String[] DEMO_RESOURCES = { - "cards.skyx", - "fitness.skyx", - "game.skyx", - "interactive_flex.skyx", - "mine_digger.skyx", - "stocks.skyx", - }; - - @Override - protected void onBeforeResourceExtraction(ResourceExtractor extractor) { - super.onBeforeResourceExtraction(extractor); - extractor.addResources(DEMO_RESOURCES); - } -} diff --git a/examples/demo_launcher/apk/release_notes/0.0.18.txt b/examples/demo_launcher/apk/release_notes/0.0.18.txt deleted file mode 100644 index 023b7f6281e..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.18.txt +++ /dev/null @@ -1 +0,0 @@ -First version published to production from our service account. \ No newline at end of file diff --git a/examples/demo_launcher/apk/release_notes/0.0.19.txt b/examples/demo_launcher/apk/release_notes/0.0.19.txt deleted file mode 100644 index 8756530cb9c..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.19.txt +++ /dev/null @@ -1,7 +0,0 @@ -Fixed a common startup crasher on Android systems before 5.0 -Fixed to not draw behind the status bar on before Android 5.0 -First release from new http://github.com/domokit/sky_engine repository. - -I suspect there may still be some crashes we will be fixing -in the coming days as we set up systems to catch these crashes -before they are shipped to users. diff --git a/examples/demo_launcher/apk/release_notes/0.0.20.txt b/examples/demo_launcher/apk/release_notes/0.0.20.txt deleted file mode 100644 index 1deb9ce393f..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.20.txt +++ /dev/null @@ -1 +0,0 @@ -Fixes crash on Nexus 6 diff --git a/examples/demo_launcher/apk/release_notes/0.0.21.txt b/examples/demo_launcher/apk/release_notes/0.0.21.txt deleted file mode 100644 index d3b495f7b58..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.21.txt +++ /dev/null @@ -1,3 +0,0 @@ -Huge speed improvements in Asteroids. -Fixed startup crash on many devices. -Lots of various other widget fixes. diff --git a/examples/demo_launcher/apk/release_notes/0.0.22.txt b/examples/demo_launcher/apk/release_notes/0.0.22.txt deleted file mode 100644 index a85c10a236c..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.22.txt +++ /dev/null @@ -1,2 +0,0 @@ -- No longer crashes on Android M Developer Preview -- 3x scrolling speed improvement. diff --git a/examples/demo_launcher/apk/release_notes/0.0.23.txt b/examples/demo_launcher/apk/release_notes/0.0.23.txt deleted file mode 100644 index 7e60f6e4c4a..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.23.txt +++ /dev/null @@ -1,3 +0,0 @@ -Small updates for various demos -Asteroids has sounds, Fitness has charting, etc. -This app is slowly being replaced by publishing individual apps. diff --git a/examples/demo_launcher/apk/release_notes/0.0.24.txt b/examples/demo_launcher/apk/release_notes/0.0.24.txt deleted file mode 100644 index df1f09a2e7e..00000000000 --- a/examples/demo_launcher/apk/release_notes/0.0.24.txt +++ /dev/null @@ -1 +0,0 @@ -Minor updates to various demos including game. diff --git a/examples/demo_launcher/apk/res/mipmap-hdpi/ic_launcher.png b/examples/demo_launcher/apk/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index b34d8110b15..00000000000 Binary files a/examples/demo_launcher/apk/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/demo_launcher/apk/res/mipmap-mdpi/ic_launcher.png b/examples/demo_launcher/apk/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 7c42388c4df..00000000000 Binary files a/examples/demo_launcher/apk/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/demo_launcher/apk/res/mipmap-xhdpi/ic_launcher.png b/examples/demo_launcher/apk/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index d57d68c1385..00000000000 Binary files a/examples/demo_launcher/apk/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/demo_launcher/apk/res/mipmap-xxhdpi/ic_launcher.png b/examples/demo_launcher/apk/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index ba3f8003ec6..00000000000 Binary files a/examples/demo_launcher/apk/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/demo_launcher/apk/res/mipmap-xxxhdpi/ic_launcher.png b/examples/demo_launcher/apk/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 8c4b3686eaf..00000000000 Binary files a/examples/demo_launcher/apk/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/demo_launcher/assets/game_thumbnail.png b/examples/demo_launcher/assets/game_thumbnail.png deleted file mode 100644 index e1cec9dfb84..00000000000 Binary files a/examples/demo_launcher/assets/game_thumbnail.png and /dev/null differ diff --git a/examples/demo_launcher/assets/sector_thumbnail.png b/examples/demo_launcher/assets/sector_thumbnail.png deleted file mode 100644 index 142e665d504..00000000000 Binary files a/examples/demo_launcher/assets/sector_thumbnail.png and /dev/null differ diff --git a/examples/demo_launcher/assets/stocks_thumbnail.png b/examples/demo_launcher/assets/stocks_thumbnail.png deleted file mode 100644 index 327708c1aaa..00000000000 Binary files a/examples/demo_launcher/assets/stocks_thumbnail.png and /dev/null differ diff --git a/examples/demo_launcher/lib/main.dart b/examples/demo_launcher/lib/main.dart deleted file mode 100644 index f2ed11c693a..00000000000 --- a/examples/demo_launcher/lib/main.dart +++ /dev/null @@ -1,210 +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 'package:flutter/material.dart'; -import 'package:flutter/painting.dart'; -import 'package:flutter/services.dart'; - -AssetBundle _initBundle() { - if (rootBundle != null) - return rootBundle; - const String _kAssetBase = '..'; - return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase)); -} - -final AssetBundle _bundle = _initBundle(); - -void launch(String relativeUrl, String bundle) { - // TODO(eseidel): This is a hack to keep non-skyx examples working for now: - Uri productionBase = Uri.parse( - 'https://domokit.github.io/example/demo_launcher/lib/main.dart'); - Uri base = rootBundle == null ? Uri.base : productionBase; - Uri url = base.resolve(relativeUrl); - - ComponentName component = new ComponentName() - ..packageName = 'org.domokit.sky.demo' - ..className = 'org.domokit.sky.demo.SkyDemoActivity'; - Intent intent = new Intent() - ..action = 'android.intent.action.VIEW' - ..component = component - ..flags = MULTIPLE_TASK | NEW_DOCUMENT - ..url = url.toString(); - - if (bundle != null) { - StringExtra extra = new StringExtra() - ..name = 'bundleName' - ..value = bundle; - intent.stringExtras = [extra]; - } - - activity.startActivity(intent); -} - -class FlutterDemo { - FlutterDemo({ - name, - this.href, - this.bundle, - this.description, - this.textTheme, - this.decoration - }) : name = name, key = new Key(name); - final String name; - final Key key; - final String href; - final String bundle; - final String description; - final TextTheme textTheme; - final BoxDecoration decoration; -} - -List demos = [ - new FlutterDemo( - name: 'Stocks', - href: '../../stocks/lib/main.dart', - bundle: 'stocks.skyx', - description: 'Multi-screen app with scrolling list', - textTheme: Typography.black, - decoration: new BoxDecoration( - backgroundImage: new BackgroundImage( - image: _bundle.loadImage('assets/stocks_thumbnail.png'), - fit: ImageFit.cover - ) - ) - ), - new FlutterDemo( - name: 'Asteroids', - href: '../../game/lib/main.dart', - bundle: 'game.skyx', - description: '2D game using sprite sheets', - textTheme: Typography.white, - decoration: new BoxDecoration( - backgroundImage: new BackgroundImage( - image: _bundle.loadImage('assets/game_thumbnail.png'), - fit: ImageFit.cover - ) - ) - ), - new FlutterDemo( - name: 'Fitness', - href: '../../fitness/lib/main.dart', - bundle: 'fitness.skyx', - description: 'Track progress towards healthy goals', - textTheme: Typography.white, - decoration: new BoxDecoration( - backgroundColor: Colors.indigo[500] - ) - ), - new FlutterDemo( - name: 'Swipe Away', - href: '../../widgets/card_collection.dart', - bundle: 'cards.skyx', - description: 'Infinite list of swipeable cards', - textTheme: Typography.white, - decoration: new BoxDecoration( - backgroundColor: Colors.redAccent[200] - ) - ), - new FlutterDemo( - name: 'Interactive Text', - href: '../../rendering/interactive_flex.dart', - bundle: 'interactive_flex.skyx', - description: 'Swipe to reflow the app', - textTheme: Typography.white, - decoration: new BoxDecoration( - backgroundColor: const Color(0xFF0081C6) - ) - ), - // new SkyDemo( - - // 'Touch Demo', '../../rendering/touch_demo.dart', 'Simple example showing handling of touch events at a low level'), - new FlutterDemo( - name: 'Minedigger Game', - href: '../../mine_digger/lib/main.dart', - bundle: 'mine_digger.skyx', - description: 'Clone of the classic Minesweeper game', - textTheme: Typography.white, - decoration: new BoxDecoration( - backgroundColor: Colors.black - ) - ), - - // TODO(jackson): This doesn't seem to be working - // new SkyDemo('Licenses', 'LICENSES.sky'), -]; - -const double kCardHeight = 120.0; -const EdgeDims kListPadding = const EdgeDims.all(4.0); - -class DemoCard extends StatelessComponent { - DemoCard({ Key key, this.demo }) : super(key: key); - - final FlutterDemo demo; - - Widget build(BuildContext context) { - return new Container( - height: kCardHeight, - child: new Card( - child: new Container( - decoration: demo.decoration, - child: new InkWell( - onTap: () => launch(demo.href, demo.bundle), - child: new Container( - margin: const EdgeDims.only(top: 24.0, left: 24.0), - child: new Column([ - new Text(demo.name, style: demo.textTheme.title), - new Flexible( - child: new Text(demo.description, style: demo.textTheme.subhead) - ) - ], - alignItems: FlexAlignItems.start - ) - ) - ) - ) - ) - ); - } -} - -class DemoList extends StatelessComponent { - Widget _buildDemoCard(BuildContext context, FlutterDemo demo) { - return new DemoCard(key: demo.key, demo: demo); - } - - Widget build(BuildContext context) { - return new ScrollableList( - items: demos, - itemExtent: kCardHeight, - itemBuilder: _buildDemoCard, - padding: kListPadding - ); - } -} - -final ThemeData _theme = new ThemeData( - brightness: ThemeBrightness.light, - primarySwatch: Colors.teal -); - -class DemoHome extends StatelessComponent { - Widget build(BuildContext context) { - return new Scaffold( - toolBar: new ToolBar(center: new Text('Sky Demos')), - body: new Material( - child: new DemoList() - ) - ); - } -} - -void main() { - runApp(new MaterialApp( - title: 'Flutter Demos', - theme: _theme, - routes: { - '/': (RouteArguments args) => new DemoHome() - } - )); -} diff --git a/examples/demo_launcher/pubspec.yaml b/examples/demo_launcher/pubspec.yaml deleted file mode 100644 index de60ccf7ab9..00000000000 --- a/examples/demo_launcher/pubspec.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: demo_launcher -dependencies: - flutter: ">=0.0.3 <0.1.0" - sky_tools: any -dependency_overrides: - material_design_icons: - path: ../../sky/packages/material_design_icons - flutter: - path: ../../sky/packages/sky diff --git a/examples/demo_launcher/sky.yaml b/examples/demo_launcher/sky.yaml deleted file mode 100644 index 4e78c110152..00000000000 --- a/examples/demo_launcher/sky.yaml +++ /dev/null @@ -1,4 +0,0 @@ -assets: - - assets/game_thumbnail.png - - assets/sector_thumbnail.png - - assets/stocks_thumbnail.png diff --git a/examples/rendering/BUILD.gn b/examples/rendering/BUILD.gn deleted file mode 100644 index 3cadbad52ad..00000000000 --- a/examples/rendering/BUILD.gn +++ /dev/null @@ -1,17 +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("//sky/build/skyx.gni") - -skyx("interactive_flex") { - main_dart = "interactive_flex.dart" -} - -group("rendering") { - testonly = true - - deps = [ - ":interactive_flex", - ] -} diff --git a/examples/widgets/BUILD.gn b/examples/widgets/BUILD.gn deleted file mode 100644 index 2de2c054ff6..00000000000 --- a/examples/widgets/BUILD.gn +++ /dev/null @@ -1,27 +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("//sky/build/skyx.gni") - -skyx("sector") { - main_dart = "sector.dart" -} - -skyx("piano") { - main_dart = "piano.dart" -} - -skyx("cards") { - main_dart = "card_collection.dart" -} - -group("widgets") { - testonly = true - - deps = [ - ":cards", - ":piano", - ":sector", - ] -} diff --git a/sky/BUILD.gn b/sky/BUILD.gn index 17214eddc16..1720d53813a 100644 --- a/sky/BUILD.gn +++ b/sky/BUILD.gn @@ -24,7 +24,6 @@ group("sky_dev") { deps = [ "//sky/packages", - "//examples/demo_launcher", "//sky/shell", ]