Remove demo_launcher
This example is outdated.
|
@ -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",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.domokit.sky.demo" android:versionCode="24" android:versionName="0.0.24">
|
||||
|
||||
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />
|
||||
|
||||
<application android:icon="@mipmap/ic_launcher" android:label="Sky" android:name="SkyDemoApplication">
|
||||
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize" android:documentLaunchMode="always" android:hardwareAccelerated="true" android:launchMode="standard" android:name="SkyDemoActivity" android:theme="@android:style/Theme.Black.NoTitleBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
|
@ -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"
|
||||
}
|
|
@ -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/
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
First version published to production from our service account.
|
|
@ -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.
|
|
@ -1 +0,0 @@
|
|||
Fixes crash on Nexus 6
|
|
@ -1,3 +0,0 @@
|
|||
Huge speed improvements in Asteroids.
|
||||
Fixed startup crash on many devices.
|
||||
Lots of various other widget fixes.
|
|
@ -1,2 +0,0 @@
|
|||
- No longer crashes on Android M Developer Preview
|
||||
- 3x scrolling speed improvement.
|
|
@ -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.
|
|
@ -1 +0,0 @@
|
|||
Minor updates to various demos including game.
|
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 56 KiB |
|
@ -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<FlutterDemo> 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<FlutterDemo>(
|
||||
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()
|
||||
}
|
||||
));
|
||||
}
|
|
@ -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
|
|
@ -1,4 +0,0 @@
|
|||
assets:
|
||||
- assets/game_thumbnail.png
|
||||
- assets/sector_thumbnail.png
|
||||
- assets/stocks_thumbnail.png
|
|
@ -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",
|
||||
]
|
||||
}
|
|
@ -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",
|
||||
]
|
||||
}
|