| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <!-- Christophe Coenraets, http://coenraets.org --> |
| <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| width="100%" height="100%" destructionPolicy="never" |
| backgroundColor="#F0F0F0" |
| creationComplete="creationComplete()" |
| viewActivate="activateHandler()" |
| viewDeactivate="deactivateHandler()"> |
| |
| <fx:Script> |
| <![CDATA[ |
| import controller.Feed; |
| |
| import mx.core.FlexGlobals; |
| |
| public var feed:Feed; |
| |
| protected function creationComplete():void |
| { |
| feed = FlexGlobals.topLevelApplication.feed; |
| list.dataProvider = feed.stockList; |
| feed.subscribe(); |
| } |
| |
| protected function activateHandler():void |
| { |
| feed.subscribe(); |
| } |
| |
| protected function deactivateHandler():void |
| { |
| feed.unsubscribe(); |
| } |
| |
| protected function listChange():void |
| { |
| feed.unsubscribe(); |
| navigator.pushView(StockView, list.selectedItem); |
| list.selectedIndex = -1; |
| } |
| |
| ]]> |
| </fx:Script> |
| |
| <s:SkinnableContainer top="0" left="0" right="0" backgroundColor="#919191" height="40"> |
| <s:layout> |
| <s:HorizontalLayout paddingLeft="0" paddingRight="0" paddingTop="0" gap="-1"/> |
| </s:layout> |
| <s:Button label="Stock" width="100%" height="100%" skinClass="skins.ListHeaderButtonSkin" fontWeight="normal"/> |
| <s:Button label="Open" width="100%" height="100%" skinClass="skins.ListHeaderButtonSkinRightAlign" fontWeight="normal"/> |
| <s:Button label="Last" width="100%" height="100%" skinClass="skins.ListHeaderButtonSkinRightAlign" fontWeight="normal"/> |
| <s:Button label="High" width="100%" height="100%" skinClass="skins.ListHeaderButtonSkinRightAlign" fontWeight="normal"/> |
| <s:Button label="Low" width="100%" height="100%" skinClass="skins.ListHeaderButtonSkinRightAlign" fontWeight="normal"/> |
| <s:Button label="" width="60" height="100%" skinClass="skins.ListHeaderButtonSkinRightAlign" fontWeight="normal"/> |
| </s:SkinnableContainer> |
| |
| <s:List id="list" itemRenderer="renderers.StockRenderer" borderVisible="false" |
| top="41" left="0" right="0" bottom="28" |
| change="listChange()"/> |
| |
| <s:Label bottom="4" text="Select stock to see real time chart" fontSize="16" color="#AAAAAA" horizontalCenter="0"/> |
| |
| </s:View> |