OLD | NEW |
1 <!-- | 1 <!-- |
2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 --> | 5 --> |
6 <import src="/sky/framework/sky-drawer-header.sky" /> | 6 <import src="/sky/framework/sky-drawer-header.sky" /> |
7 <import src="/sky/framework/sky-drawer.sky" /> | 7 <import src="/sky/framework/sky-drawer.sky" /> |
8 <import src="/sky/framework/sky-element.sky" /> | 8 <import src="/sky/framework/sky-element.sky" /> |
9 <import src="/sky/framework/sky-icon.sky" /> | 9 <import src="/sky/framework/sky-icon.sky" /> |
10 <import src="/sky/framework/sky-menu-divider.sky" /> | 10 <import src="/sky/framework/sky-menu-divider.sky" /> |
11 <import src="/sky/framework/sky-menu-item.sky" /> | 11 <import src="/sky/framework/sky-menu-item.sky" /> |
12 <import src="/sky/framework/sky-scrollable.sky" /> | 12 <import src="/sky/framework/sky-scrollable.sky" /> |
13 <import src="/sky/framework/sky-toolbar.sky" /> | 13 <import src="/sky/framework/sky-toolbar.sky" /> |
14 <import src="stock.sky" as='view'/> | 14 <import src="stock.sky" as='view'/> |
15 <import src='companylist.sky' as='model'/> | |
16 | 15 |
17 <sky-element> | 16 <sky-element> |
18 <template> | 17 <template> |
19 <style> | 18 <style> |
20 :host { | 19 :host { |
21 display: flex; | 20 display: flex; |
22 flex-direction: column; | 21 flex-direction: column; |
23 height: -webkit-fill-available; | 22 height: -webkit-fill-available; |
24 font-family: 'Roboto Regular', 'Helvetica'; | 23 font-family: 'Roboto Regular', 'Helvetica'; |
25 font-size: 16px; | 24 font-size: 16px; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 <div id="title">I am a stocks app</div> | 63 <div id="title">I am a stocks app</div> |
65 <sky-icon type="action/search_white" size="24" /> | 64 <sky-icon type="action/search_white" size="24" /> |
66 <sky-icon type="navigation/more_vert_white" size="24" /> | 65 <sky-icon type="navigation/more_vert_white" size="24" /> |
67 </sky-toolbar> | 66 </sky-toolbar> |
68 <sky-scrollable id='stock_list'> | 67 <sky-scrollable id='stock_list'> |
69 </sky-scrollable> | 68 </sky-scrollable> |
70 </template> | 69 </template> |
71 <script> | 70 <script> |
72 import "dart:sky"; | 71 import "dart:sky"; |
73 import "dart:math"; | 72 import "dart:math"; |
| 73 import "../data/stocks.dart" as model; |
74 | 74 |
75 List pick(List list, int count) { | 75 List pick(List list, int count) { |
76 var rng = new Random(); | 76 var rng = new Random(); |
77 List picked = new List(); | 77 List picked = new List(); |
78 for (int i = 0; i < count; i++) { | 78 for (int i = 0; i < count; i++) { |
79 picked.add(list[rng.nextInt(list.length)]); | 79 picked.add(list[rng.nextInt(list.length)]); |
80 } | 80 } |
81 return picked; | 81 return picked; |
82 } | 82 } |
83 | 83 |
(...skipping 19 matching lines...) Expand all Loading... |
103 } | 103 } |
104 | 104 |
105 void _handleMenuClick(_) { | 105 void _handleMenuClick(_) { |
106 _drawer.toggle(); | 106 _drawer.toggle(); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 _init(script) => register(script, Stocks); | 110 _init(script) => register(script, Stocks); |
111 </script> | 111 </script> |
112 </sky-element> | 112 </sky-element> |
OLD | NEW |