Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: sky/framework/components/input.dart

Issue 1036783002: Add an implict animation between ActionBar backgrounds (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/framework/components/action_bar.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../editing/editable_string.dart'; 5 import '../editing/editable_string.dart';
6 import '../editing/editable_text.dart'; 6 import '../editing/editable_text.dart';
7 import '../editing/keyboard.dart'; 7 import '../editing/keyboard.dart';
8 import '../fn.dart'; 8 import '../fn.dart';
9 import '../theme/colors.dart'; 9 import '../theme/colors.dart';
10 import '../theme/typography.dart' as typography;
10 11
11 typedef void ValueChanged(value); 12 typedef void ValueChanged(value);
12 13
13 class Input extends Component { 14 class Input extends Component {
14 static final Style _style = new Style(''' 15 static final Style _style = new Style('''
15 display: paragraph; 16 display: paragraph;
16 transform: translateX(0); 17 transform: translateX(0);
17 margin: 8px; 18 margin: 8px;
18 padding: 8px; 19 padding: 8px;
19 border-bottom: 1px solid ${Grey[200]}; 20 border-bottom: 1px solid ${Grey[200]};
20 align-self: center; 21 align-self: center;
21 height: 1.2em; 22 height: 1.2em;
22 white-space: pre; 23 white-space: pre;
23 overflow: hidden;''' 24 overflow: hidden;'''
24 ); 25 );
25 26
26 static final Style _placeholderStyle = new Style(''' 27 static final Style _placeholderStyle = new Style('''
27 top: 8px; 28 top: 8px;
28 left: 8px; 29 left: 8px;
29 color: ${Grey[200]}; 30 position: absolute;
30 position: absolute;''' 31 ${typography.black.caption};'''
31 ); 32 );
32 33
33 static final String _focusedInlineStyle = ''' 34 static final String _focusedInlineStyle = '''
34 padding: 7px; 35 padding: 7px;
35 border-bottom: 2px solid ${Blue[500]};'''; 36 border-bottom: 2px solid ${Blue[500]};''';
36 37
37 ValueChanged onChanged; 38 ValueChanged onChanged;
38 String placeholder; 39 String placeholder;
39 bool focused = false; 40 bool focused = false;
40 41
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 82
82 children.add(new EditableText(value: _editableValue, focused: focused)); 83 children.add(new EditableText(value: _editableValue, focused: focused));
83 84
84 return new Container( 85 return new Container(
85 style: _style, 86 style: _style,
86 inlineStyle: focused ? _focusedInlineStyle : null, 87 inlineStyle: focused ? _focusedInlineStyle : null,
87 children: children 88 children: children
88 ); 89 );
89 } 90 }
90 } 91 }
OLDNEW
« no previous file with comments | « sky/framework/components/action_bar.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698