Add SetRequestedOrientation to Activity service

Fixes #743
This commit is contained in:
Adam Barth
2015-08-21 11:27:17 -07:00
parent e95aee2715
commit 51c7194075
19 changed files with 49 additions and 101 deletions

View File

@@ -135,8 +135,8 @@ class AddressBookApp extends App {
data: theme,
child: new DefaultTextStyle(
style: typography.error, // if you see this, you've forgotten to correctly configure the text style!
child: new TaskDescription(
label: 'Address Book',
child: new Title(
title: 'Address Book',
child: new Navigator(_navigationState)
)
)

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/mojo/activity.dart' as activity;
import 'package:sky/mojo/activity.dart';
import 'package:sky/mojo/asset_bundle.dart';
import 'package:sky/painting/box_painter.dart';
import 'package:sky/theme/colors.dart' as colors;
@@ -25,17 +25,17 @@ EventDisposition launch(String relativeUrl, String bundle) {
Uri base = rootBundle == null ? Uri.base : productionBase;
Uri url = base.resolve(relativeUrl);
activity.ComponentName component = new activity.ComponentName()
ComponentName component = new ComponentName()
..packageName = 'org.domokit.sky.demo'
..className = 'org.domokit.sky.demo.SkyDemoActivity';
activity.Intent intent = new activity.Intent()
Intent intent = new Intent()
..action = 'android.intent.action.VIEW'
..component = component
..flags = activity.MULTIPLE_TASK | activity.NEW_DOCUMENT
..flags = MULTIPLE_TASK | NEW_DOCUMENT
..url = url.toString();
if (bundle != null) {
activity.StringExtra extra = new activity.StringExtra()
StringExtra extra = new StringExtra()
..name = 'bundleName'
..value = bundle;
intent.stringExtras = [extra];
@@ -191,8 +191,8 @@ class SkyHome extends App {
brightness: ThemeBrightness.light,
primarySwatch: colors.Teal
),
child: new TaskDescription(
label: 'Sky Demos',
child: new Title(
title: 'Sky Demos',
child: new Scaffold(
toolbar: new ToolBar(center: new Text('Sky Demos')),
body: new Material(

View File

@@ -171,8 +171,8 @@ class FitnessApp extends App {
primarySwatch: colors.Indigo,
accentColor: colors.PinkAccent[200]
),
child: new TaskDescription(
label: 'Fitness',
child: new Title(
title: 'Fitness',
child: new Navigator(_navigationState)
)
);

View File

@@ -12,7 +12,7 @@ import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/button_base.dart';
import 'package:sky/widgets/navigator.dart';
import 'package:sky/widgets/framework.dart';
import 'package:sky/widgets/task_description.dart';
import 'package:sky/widgets/title.dart';
import 'package:sky/widgets/theme.dart';
import 'game_demo.dart';
@@ -104,8 +104,8 @@ class GameDemoApp extends App {
return new Theme(
data: theme,
child: new TaskDescription(
label: 'Asteroids',
child: new Title(
title: 'Asteroids',
child: new Navigator(_navigationState)
)
);

View File

@@ -6,8 +6,7 @@ import 'package:sky/mojo/asset_bundle.dart';
import 'package:sky/rendering/object.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/task_description.dart';
import 'package:sky/widgets/theme.dart';
import 'package:sky/widgets.dart';
AssetBundle _initBundle() {
if (rootBundle != null)
@@ -45,8 +44,8 @@ class TestDrawAtlasApp extends App {
return new Theme(
data: theme,
child: new TaskDescription(
label: 'Test drawAtlas',
child: new Title(
title: 'Test drawAtlas',
child: new SpriteWidget(
new TestDrawAtlas(),
SpriteBoxTransformMode.fixedWidth

View File

@@ -4,9 +4,7 @@ import 'dart:math' as math;
import 'package:sky/mojo/asset_bundle.dart';
import 'package:sky/rendering/object.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/task_description.dart';
import 'package:sky/widgets/theme.dart';
import 'package:sky/widgets.dart';
import 'lib/sprites.dart';
@@ -46,8 +44,8 @@ class TestApp extends App {
return new Theme(
data: theme,
child: new TaskDescription(
label: 'Test Sprite Performance',
child: new Title(
title: 'Test Sprite Performance',
child: new SpriteWidget(new TestPerformance())
)
);

View File

@@ -183,8 +183,8 @@ class MineDiggerApp extends App {
Widget build() {
// We build the board before we build the toolbar because we compute the win state during build step.
Widget board = buildBoard();
return new TaskDescription(
label: 'Mine Digger',
return new Title(
title: 'Mine Digger',
child: new Scaffold(
toolbar: buildToolBar(),
body: new Container(

View File

@@ -5,7 +5,7 @@
import 'dart:sky';
import 'dart:math' as math;
import 'package:sky/mojo/activity.dart' as activity;
import 'package:sky/mojo/activity.dart';
import 'package:sky/mojo/net/image_cache.dart' as image_cache;
import 'package:sky/rendering.dart';
@@ -98,7 +98,7 @@ Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
child: row
);
activity.updateTaskDescription('Interactive Flex', topColor);
updateTaskDescription('Interactive Flex', topColor);
new SkyBinding(root: root);
view.setEventCallback(handleEvent);
}

View File

@@ -95,8 +95,8 @@ class StocksApp extends App {
data: theme,
child: new DefaultTextStyle(
style: typography.error, // if you see this, you've forgotten to correctly configure the text style!
child: new TaskDescription(
label: 'Stocks',
child: new Title(
title: 'Stocks',
child: new Navigator(_navigationState)
)
)

View File

@@ -117,8 +117,8 @@ class CardCollectionApp extends App {
primarySwatch: colors.Blue,
accentColor: colors.RedAccent[200]
),
child: new TaskDescription(
label: 'Cards',
child: new Title(
title: 'Cards',
child: new Scaffold(
toolbar: new ToolBar(center: new Text('Swipe Away')),
body: cardCollection

View File

@@ -21,7 +21,7 @@ class EnsureVisibleApp extends App {
const TextStyle(color: colors.white, fontSize: 18.0, fontWeight: bold);
static const TextStyle selectedCardLabelStyle =
const TextStyle(color: white, fontSize: 24.0, fontWeight: bold);
const TextStyle(color: colors.white, fontSize: 24.0, fontWeight: bold);
List<CardModel> cardModels;
BlockViewportLayoutState layoutState = new BlockViewportLayoutState();
@@ -89,8 +89,8 @@ class EnsureVisibleApp extends App {
primarySwatch: colors.Blue,
accentColor: colors.RedAccent[200]
),
child: new TaskDescription(
label: 'Cards',
child: new Title(
title: 'Cards',
child: new Scaffold(
toolbar: new ToolBar(center: new Text('Tap a Card')),
body: cardCollection

View File

@@ -167,7 +167,7 @@ class OverlayGeometryApp extends App {
primarySwatch: colors.Blue,
accentColor: colors.RedAccent[200]
),
child: new TaskDescription(label: 'Cards', child: new Stack(layers))
child: new Title(title: 'Cards', child: new Stack(layers))
)
);
}

View File

@@ -3,17 +3,8 @@
// found in the LICENSE file.
import 'package:sky/base/lerp.dart';
import 'package:sky/painting/text_style.dart';
import 'package:sky/theme/colors.dart';
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/card.dart';
import 'package:sky/widgets/icon.dart';
import 'package:sky/widgets/scrollable.dart';
import 'package:sky/widgets/scaffold.dart';
import 'package:sky/widgets/theme.dart';
import 'package:sky/widgets/tool_bar.dart';
import 'package:sky/widgets/framework.dart';
import 'package:sky/widgets/task_description.dart';
import 'package:sky/widgets.dart';
class CardModel {
CardModel(this.value, this.size, this.color);
@@ -105,8 +96,8 @@ class PageableListApp extends App {
primarySwatch: Blue,
accentColor: RedAccent[200]
),
child: new TaskDescription(
label: 'PageableList',
child: new Title(
title: 'PageableList',
child: new Scaffold(
toolbar: new Listener(
onGestureTap: handleToolbarTap,

View File

@@ -98,8 +98,8 @@ class ProgressIndicatorApp extends App {
primarySwatch: colors.Blue,
accentColor: colors.RedAccent[200]
),
child: new TaskDescription(
label: 'Cards',
child: new Title(
title: 'Cards',
child: new Scaffold(
toolbar: new ToolBar(center: new Text('Progress Indicators')),
body: body

View File

@@ -122,8 +122,8 @@ class SectorApp extends App {
Widget build() {
return new Theme(
data: new ThemeData.light(),
child: new TaskDescription(
label: 'Sector Layout',
child: new Title(
title: 'Sector Layout',
child: new Scaffold(
toolbar: new ToolBar(
center: new Text('Sector Layout in a Widget Tree')