| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:sky/painting/text_style.dart'; | 5 import 'package:sky/painting/text_style.dart'; |
| 6 import 'package:sky/widgets/basic.dart'; | 6 import 'package:sky/widgets/basic.dart'; |
| 7 import 'package:sky/widgets/drawer.dart'; | 7 import 'package:sky/widgets/drawer.dart'; |
| 8 import 'package:sky/widgets/drawer_header.dart'; | 8 import 'package:sky/widgets/drawer_header.dart'; |
| 9 import 'package:sky/widgets/floating_action_button.dart'; | 9 import 'package:sky/widgets/floating_action_button.dart'; |
| 10 import 'package:sky/widgets/icon.dart'; | 10 import 'package:sky/widgets/icon.dart'; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 String get fitnessModeTitle { | 109 String get fitnessModeTitle { |
| 110 switch(_fitnessMode) { | 110 switch(_fitnessMode) { |
| 111 case FitnessMode.measure: return "Measure"; | 111 case FitnessMode.measure: return "Measure"; |
| 112 case FitnessMode.run: return "Run"; | 112 case FitnessMode.run: return "Run"; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 Widget buildToolBar() { | 116 Widget buildToolBar() { |
| 117 return new ToolBar( | 117 return new ToolBar( |
| 118 left: new IconButton( | 118 left: new IconButton( |
| 119 icon: 'navigation/menu_white', | 119 icon: "navigation/menu", |
| 120 onPressed: _handleOpenDrawer), | 120 onPressed: _handleOpenDrawer), |
| 121 center: new Text(fitnessModeTitle) | 121 center: new Text(fitnessModeTitle) |
| 122 ); | 122 ); |
| 123 } | 123 } |
| 124 | 124 |
| 125 Widget buildBody() { | 125 Widget buildBody() { |
| 126 TextStyle style = Theme.of(this).text.title; | 126 TextStyle style = Theme.of(this).text.title; |
| 127 switch (_fitnessMode) { | 127 switch (_fitnessMode) { |
| 128 case FitnessMode.measure: | 128 case FitnessMode.measure: |
| 129 return new Material( | 129 return new Material( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 void _handleRunStopped() { | 173 void _handleRunStopped() { |
| 174 setState(() { | 174 setState(() { |
| 175 _isRunning = false; | 175 _isRunning = false; |
| 176 }); | 176 }); |
| 177 } | 177 } |
| 178 | 178 |
| 179 Widget buildFloatingActionButton() { | 179 Widget buildFloatingActionButton() { |
| 180 switch (_fitnessMode) { | 180 switch (_fitnessMode) { |
| 181 case FitnessMode.measure: | 181 case FitnessMode.measure: |
| 182 return new FloatingActionButton( | 182 return new FloatingActionButton( |
| 183 child: new Icon(type: 'content/add_white', size: 24), | 183 child: new Icon(type: 'content/add', size: 24), |
| 184 onPressed: _handleMeasurementAdded | 184 onPressed: _handleMeasurementAdded |
| 185 ); | 185 ); |
| 186 case FitnessMode.run: | 186 case FitnessMode.run: |
| 187 return new FloatingActionButton( | 187 return new FloatingActionButton( |
| 188 child: new Icon( | 188 child: new Icon( |
| 189 type: _isRunning ? 'av/stop_white' : 'maps/directions_run_white', | 189 type: _isRunning ? 'av/stop' : 'maps/directions_run', |
| 190 size: 24 | 190 size: 24 |
| 191 ), | 191 ), |
| 192 onPressed: _isRunning ? _handleRunStopped : _handleRunStarted | 192 onPressed: _isRunning ? _handleRunStopped : _handleRunStarted |
| 193 ); | 193 ); |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 Widget build() { | 197 Widget build() { |
| 198 return new Scaffold( | 198 return new Scaffold( |
| 199 toolbar: buildToolBar(), | 199 toolbar: buildToolBar(), |
| 200 body: buildBody(), | 200 body: buildBody(), |
| 201 snackBar: buildSnackBar(), | 201 snackBar: buildSnackBar(), |
| 202 floatingActionButton: buildFloatingActionButton(), | 202 floatingActionButton: buildFloatingActionButton(), |
| 203 drawer: _drawerShowing ? buildDrawer() : null | 203 drawer: _drawerShowing ? buildDrawer() : null |
| 204 ); | 204 ); |
| 205 } | 205 } |
| 206 } | 206 } |
| OLD | NEW |