| <?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. | |
| --> | |
| <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" | |
| xmlns:s="library://ns.adobe.com/flex/spark" | |
| xmlns:productsView="productsView.*" | |
| > | |
| <fx:Metadata> | |
| [Event(name="purchase", type="samples.flexstore.ProductThumbEvent")] | |
| [Event(name="compare", type="samples.flexstore.ProductThumbEvent")] | |
| [Event(name="browse", type="samples.flexstore.ProductThumbEvent")] | |
| </fx:Metadata> | |
| <fx:Script> | |
| <![CDATA[ | |
| import mx.events.*; | |
| import samples.flexstore.Product; | |
| import samples.flexstore.ProductThumbEvent; | |
| private var _product:Product; | |
| [Bindable] | |
| public function get product():Product | |
| { | |
| return _product; | |
| } | |
| public function set product(p:Product):void | |
| { | |
| _product = p; | |
| tn.selectedIndex = 0; | |
| } | |
| ]]> | |
| </fx:Script> | |
| <fx:Declarations> | |
| <s:CurrencyFormatter currencySymbol="$" id="cf" fractionalDigits="2"/> | |
| </fx:Declarations> | |
| <s:states> | |
| <s:State name="Features" /> | |
| <s:State name="Support" /> | |
| </s:states> | |
| <s:transitions> | |
| <s:Transition> | |
| <s:Fade /> | |
| </s:Transition> | |
| </s:transitions> | |
| <s:TabBar id="tn" width="100%" change="currentState = tn.selectedItem"> | |
| <s:dataProvider> | |
| <s:ArrayList> | |
| <fx:Array> | |
| <fx:String>Features</fx:String> | |
| <fx:String>Support</fx:String> | |
| </fx:Array> | |
| </s:ArrayList> | |
| </s:dataProvider> | |
| </s:TabBar> | |
| <s:Group width="100%" height="100%" | |
| left="4" right="8" top="34" bottom="4"> | |
| <s:VGroup width="100%" height="100%" includeIn="Features" gap="8" | |
| paddingLeft="8" paddingTop="8" paddingRight="8" paddingBottom="8"> | |
| <s:HGroup width="100%" gap="12"> | |
| <s:Image id="img" width="101" height="200" source="{product.image}"/> | |
| <s:VGroup id="descr" width="100%" height="100%" paddingTop="0" gap="4"> | |
| <s:Label text="{product.name}" fontSize="11" fontWeight="bold"/> | |
| <s:Label text="{product.featureString}" width="80" height="48" maxDisplayedLines="4"/> | |
| <s:Label text="{product.highlight1}" color="#EE8D0C"/> | |
| <s:Label text="{product.highlight2}" color="#EE8D0C"/> | |
| <s:Label text="{cf.format(product.price)}" fontWeight="bold"/> | |
| </s:VGroup> | |
| </s:HGroup> | |
| <s:Label id="descriptionText" width="100%" height="100%" text="{product.description}" maxDisplayedLines="0"/> | |
| </s:VGroup> | |
| <productsView:ProductSupport width="100%" height="100%" includeIn="Support" /> | |
| </s:Group> | |
| <s:VGroup gap="4" right="16" top="36"> | |
| <s:Spacer width="100%"/> | |
| <s:Button icon="@Embed('/assets/icon_cart_empty.png')" click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.PURCHASE, product))" width="30" toolTip="Add to cart"/> | |
| <s:Button icon="@Embed('/assets/icon_compare.png')" click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.COMPARE, product))" width="30" toolTip="Add to compare list"/> | |
| <s:Button icon="@Embed('/assets/icon_tiles.png')" click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.BROWSE, product));" width="30" toolTip="Back to thumbnail view"/> | |
| </s:VGroup> | |
| </s:Group> |