Repository: flex-asjs Updated Branches: refs/heads/develop 98315b1f7 -> 963de73e7
Updates MobileTrader main view to address issues with navigation. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/963de73e Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/963de73e Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/963de73e Branch: refs/heads/develop Commit: 963de73e771d9603dd08027318f8e5fd2fdbc6c6 Parents: 98315b1 Author: Peter Ent <[email protected]> Authored: Tue Mar 17 10:19:02 2015 -0400 Committer: Peter Ent <[email protected]> Committed: Tue Mar 17 10:19:02 2015 -0400 ---------------------------------------------------------------------- examples/MobileTrader/src/MyInitialView.mxml | 200 +++++++++++++--------- 1 file changed, 115 insertions(+), 85 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/963de73e/examples/MobileTrader/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/examples/MobileTrader/src/MyInitialView.mxml b/examples/MobileTrader/src/MyInitialView.mxml index 0fd0916..b50490f 100644 --- a/examples/MobileTrader/src/MyInitialView.mxml +++ b/examples/MobileTrader/src/MyInitialView.mxml @@ -22,109 +22,139 @@ limitations under the License. xmlns:views="views.*" xmlns:apache="org.apache.flex.html.beads.*" xmlns:html="org.apache.flex.html.*"> - <fx:Script> - <![CDATA[ - private function onAssetsNext():void - { - - } - ]]> - </fx:Script> - <fx:Style> + + + <fx:Style> @namespace basic "library://ns.apache.org/flexjs/basic"; @namespace views "views.*"; - basic|Container { - background-color: #FFFFFF; - } - - basic|StackedViewManager { - padding-top: 0px; - padding-bottom: 0px; - padding-left: 0px; - padding-right: 0px; - } - - basic|TabbedViewManager { - position : absolute ; - height : 640px ; - width : 480px ; - left : 100px ; - top : 20px ; - border: solid 1px #444444; - background-color: #FFFFFF; - } - - .NavigationBar { - background-image: url("assets/background.png"); - height: 55px; - IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.NonVirtualHorizontalLayout"); - } - - .TabBar { - background-color: #DEDEDE; - height: 55px; - vertical-align: middle; - line-height: 55px; - } + basic|Container { + background-color: #FFFFFF; + } - .BackButton:hover { - background-image: url('assets/arrow_left_24.png'); - } - - .BackButton:active { - background-image: url('assets/arrow_left_24.png'); - } - - .BackButton { - background-image: url('assets/arrow_left_24.png'); - } - - .AssetsInner { - padding: 10px; - } - - views|AssetsView { - width: 480px; - height: 640px; - } + basic|StackedViewManager { + padding-top: 0px; + padding-bottom: 0px; + padding-left: 0px; + padding-right: 0px; + } - views|WatchListView { - width: 480px; - height: 640px; - } - - views|StockView { - width: 480px; - height: 640px; + basic|TabbedViewManager { + position : absolute ; + height : 640px ; + width : 480px ; + left : 100px ; + top : 20px ; + border: solid 1px #444444; + background-color: #FFFFFF; + } + + .NavigationBar { + background-image: url("assets/background.png"); + height: 55px; + IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.NonVirtualHorizontalLayout"); + } + + .TabBar { + background-color: #DEDEDE; + height: 55px; + vertical-align: middle; + line-height: 55px; + } + + .BackButton:hover { + background-image: url('assets/arrow_left_24.png'); + } + + .BackButton:active { + background-image: url('assets/arrow_left_24.png'); + } + + .BackButton { + background-image: url('assets/arrow_left_24.png'); + } + + .AssetsInner { + padding: 10px; + } + + views|AssetsView { + width: 480px; + height: 640px; + } + + views|WatchListView { + width: 480px; + height: 640px; + } + + views|StockView { + width: 480px; + height: 640px; + } + + views|AlertsView { + width: 480px; + height: 640px; + } + + .redCell { + color: #FF0000; + } + + .greenCell { + color: #00FF00; + } + + @media -flex-flash + { + .NavigationBar { + IBackgroundBead: ClassReference("org.apache.flex.html.beads.BackgroundImageBead"); } + } + + </fx:Style> + + <fx:Script> + <![CDATA[ + import org.apache.flex.events.Event; + import org.apache.flex.mobile.IView; + import org.apache.flex.mobile.IViewManager; + import org.apache.flex.mobile.chrome.NavigationBar; - views|AlertsView { - width: 480px; - height: 640px; + private function onAssetsNext():void + { + } - .redCell { - color: #FF0000; + private function tabbedViewChanged(event:org.apache.flex.events.Event):void + { + var manager:IViewManager = event.currentTarget as IViewManager; + trace("TabbedViewChanged for "+manager); } - .greenCell { - color: #00FF00; + private function watchListStackChanged(event:org.apache.flex.events.Event):void + { + trace("watchlist stack changed"); + var manager:StackedViewManager = event.currentTarget as StackedViewManager; + + var currentView:IView = manager.selectedView; + backButton.visible = manager.views.length > 1; } - @media -flex-flash + private function goBack(event:org.apache.flex.events.Event):void { - .NavigationBar { - IBackgroundBead: ClassReference("org.apache.flex.html.beads.BackgroundImageBead"); + if (navController.selectedIndex == 1) { + watchListStack.pop(); } } - - </fx:Style> + ]]> + </fx:Script> - <basic:TabbedViewManager id="navController" width="480" height="640" x="0" y="0"> + <basic:TabbedViewManager id="navController" width="480" height="640" x="0" y="0" viewChanged="tabbedViewChanged(event)"> <basic:navigationBarItems> - <basic:TextButton id="backButton" width="45" height="45" className="BackButton" visible="false"> + <basic:TextButton id="backButton" width="45" height="45" className="BackButton" visible="false" click="goBack(event)"> <basic:beads> <apache:ImageButtonView /> </basic:beads> @@ -138,7 +168,7 @@ limitations under the License. </basic:views> </basic:StackedViewManager> - <basic:StackedViewManager title="Watch List"> + <basic:StackedViewManager id="watchListStack" title="Watch List" viewChanged="watchListStackChanged(event)"> <basic:views> <views:WatchListView id="watchListView" /> </basic:views>
