Commit c47a82d5 authored by Eric Seidel's avatar Eric Seidel

Give the Stocks2 App a new improved toolbar.

Looks horrible.  But it's a start.

R=abarth@chromium.org, ianh@google.com
BUG=

Review URL: https://codereview.chromium.org/1146913005
parent 3118a6fb
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// import 'package:sky/framework/components2/tool_bar.dart'; import 'package:sky/framework/components2/tool_bar.dart';
// import 'package:sky/framework/components2/drawer.dart'; // import 'package:sky/framework/components2/drawer.dart';
// import 'package:sky/framework/components2/drawer_header.dart'; // import 'package:sky/framework/components2/drawer_header.dart';
// import 'package:sky/framework/components2/floating_action_button.dart'; // import 'package:sky/framework/components2/floating_action_button.dart';
// import 'package:sky/framework/components2/icon.dart'; // import 'package:sky/framework/components2/icon.dart';
// import 'package:sky/framework/components2/icon_button.dart'; import 'package:sky/framework/components2/icon_button.dart';
// import 'package:sky/framework/components2/input.dart'; // import 'package:sky/framework/components2/input.dart';
// import 'package:sky/framework/components2/menu_divider.dart'; // import 'package:sky/framework/components2/menu_divider.dart';
// import 'package:sky/framework/components2/menu_item.dart'; // import 'package:sky/framework/components2/menu_item.dart';
...@@ -19,18 +19,17 @@ import 'package:sky/framework/fn2.dart'; ...@@ -19,18 +19,17 @@ import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/theme/typography.dart' as typography; import 'package:sky/framework/theme/typography.dart' as typography;
import 'package:sky/framework/theme/colors.dart'; import 'package:sky/framework/theme/colors.dart';
import 'stock_data.dart'; import 'stock_data.dart';
import 'package:sky/framework/rendering/box.dart';
// import 'stock_list.dart'; // import 'stock_list.dart';
// import 'stock_menu.dart'; // import 'stock_menu.dart';
import 'dart:async'; import 'dart:async';
import 'dart:sky' as sky;
enum StockMode { Optimistic, Pessimistic } enum StockMode { Optimistic, Pessimistic }
class StocksApp extends App { class StocksApp extends App {
// static final Style _toolBarStyle = new Style('''
// background-color: ${Purple[500]};''');
// static final Style _searchBarStyle = new Style(''' // static final Style _searchBarStyle = new Style('''
// background-color: ${Grey[50]};'''); // background-color: ${Grey[50]};''');
...@@ -161,24 +160,21 @@ class StocksApp extends App { ...@@ -161,24 +160,21 @@ class StocksApp extends App {
// } // }
UINode buildToolBar() { UINode buildToolBar() {
return new Rectangle(0xFF00FF00); return new ToolBar(
// return new StyleNode( left: new IconButton(
// new ToolBar( icon: 'navigation/menu_white',
// left: new IconButton( onGestureTap: (_) => true), // _drawerController.toggle),
// icon: 'navigation/menu_white', center: new Text('Stocks'),
// onGestureTap: _drawerController.toggle), right: [
// center: new Container( new IconButton(
// style: _titleStyle, icon: 'action/search_white',
// children: [new Text('Stocks')]), onGestureTap: _handleSearchBegin),
// right: [ new IconButton(
// new IconButton( icon: 'navigation/more_vert_white',
// icon: 'action/search_white', onGestureTap: _handleMenuShow)
// onGestureTap: _handleSearchBegin), ],
// new IconButton( backgroundColor: colorFromCSSHexColorString(Purple[500])
// icon: 'navigation/more_vert_white', );
// onGestureTap: _handleMenuShow)
// ]),
// _toolBarStyle);
} }
// TODO(abarth): Should we factor this into a SearchBar in the framework? // TODO(abarth): Should we factor this into a SearchBar in the framework?
...@@ -210,16 +206,22 @@ class StocksApp extends App { ...@@ -210,16 +206,22 @@ class StocksApp extends App {
UINode build() { UINode build() {
// List<UINode> overlays = []; // List<UINode> overlays = [];
// addMenuToOverlays(overlays); // addMenuToOverlays(overlays);
return new Container(
child: new BlockContainer(children: [buildToolBar()]),
decoration: new BoxDecoration(
backgroundColor: 0xFFFFFFFF
)
);
return new Scaffold( // return new Scaffold(
toolbar: _isSearching ? buildSearchBar() : buildToolBar() // toolbar: _isSearching ? buildSearchBar() : buildToolBar()
// , // ,
// body: new Stocklist(stocks: _stocks, query: _searchQuery), // body: new Stocklist(stocks: _stocks, query: _searchQuery),
// floatingActionButton: new FloatingActionButton( // floatingActionButton: new FloatingActionButton(
// content: new Icon(type: 'content/add_white', size: 24), level: 3), // content: new Icon(type: 'content/add_white', size: 24), level: 3),
// drawer: _drawerShowing ? buildDrawer() : null, // drawer: _drawerShowing ? buildDrawer() : null,
// overlays: overlays // overlays: overlays
); // );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment