<?xml version="1.0" encoding="utf-8"?>
<!--
The MIT License

Copyright (c) 2009 Jason Graham

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="flexsamples.components.*" viewSourceURL="srcview/index.html">
  <mx:Style source="styles/CollapsibleAccordionStyle.css"/>
  <mx:Model id="listSample" source="sampledata/listsample.xml"/>
  
  <mx:HBox height="100%" width="100%" horizontalGap="0">
    <components:CollapsibleAccordion id="collapsibleAccordion1" 
      height="100%"
      orientation="right"
      barSize="36"
      currentWidth="36"
      drawerButtonStyle="drawerButton"
      closeButtonStyle="drawerCloseRight"
      accordianStyle="drawerAccordion">
      <mx:Canvas width="100%" height="100%" label="Email" icon="@Embed(source='assets/email-48x48.png')">
        <mx:TileList id="list" width="100%" columnWidth="{list.width}" height="100%" dataProvider="{listSample.item}" horizontalCenter="0">
          <mx:itemRenderer>
            <mx:Component>
              <mx:VBox horizontalAlign="center" horizontalCenter="0"
                  verticalGap="0" backgroundAlpha="0" width="100%" height="100%">
                  <mx:Image id="image" scaleContent="true" horizontalCenter="0" width="128" height="128" source="{data.image}"/>
                  <mx:Label text="{data.name}" width="100%" textAlign="center"/>
              </mx:VBox>                
            </mx:Component>
          </mx:itemRenderer>
        </mx:TileList>
      </mx:Canvas> 
      <mx:Canvas width="100%" height="100%" label="Articles" icon="@Embed(source='assets/article-48x48.png')">
        <mx:TextArea text="Content" width="100%" height="100%"/>
      </mx:Canvas>
    </components:CollapsibleAccordion>
    <components:CollapsibleAccordion id="collapsibleAccordion2" 
      height="100%"
      openSize="400"
      orientation="right"
      barSize="36"
      currentWidth="36"
      drawerButtonStyle="drawerButton"
      closeButtonStyle="drawerCloseRight"
      accordianStyle="drawerAccordion">
      <mx:Canvas width="100%" height="100%" label="RSS Feeds" icon="@Embed(source='assets/rss-48x48.png')">
        <mx:TextArea text="Content" width="100%" height="100%"/>
      </mx:Canvas>
      <mx:Canvas width="100%" height="100%" label="Articles" icon="@Embed(source='assets/article-48x48.png')">
        <mx:TextArea text="Content" width="100%" height="100%"/>
      </mx:Canvas>
      <mx:Canvas width="100%" height="100%" label="RSS Feeds" icon="@Embed(source='assets/rss-48x48.png')">
        <mx:TextArea text="Content" width="100%" height="100%"/>
      </mx:Canvas>
    </components:CollapsibleAccordion>
    <mx:Panel title="Content Area" width="100%" height="100%">
      <mx:Button label="Select-Collapsible Accordion 1-0" click="collapsibleAccordion1.selectedIndex=0;"/>  
      <mx:Button label="Select-Collapsible Accordion 1-1" click="collapsibleAccordion1.selectedIndex=1;"/>  
      <mx:Button label="Select-Collapsible Accordion 2-0" click="collapsibleAccordion2.selectedIndex=0;"/>  
      <mx:Button label="Select-Collapsible Accordion 2-1" click="collapsibleAccordion2.selectedIndex=1;"/>  
      <mx:Button label="Select-Collapsible Accordion 2-2" click="collapsibleAccordion2.selectedIndex=2;"/>  
      <mx:Button label="Select-Collapsible Accordion 3-0" click="collapsibleAccordion3.selectedIndex=0;"/>  
      <mx:Button label="Select-Collapsible Accordion 3-1" click="collapsibleAccordion3.selectedIndex=1;"/>  
    </mx:Panel>
    <components:CollapsibleAccordion id="collapsibleAccordion3" 
      height="100%"
      orientation="left"
      barSize="36"
      currentWidth="36"
      drawerButtonStyle="drawerButton"
      closeButtonStyle="drawerCloseRight"
      accordianStyle="drawerAccordion">
      <mx:Canvas width="100%" height="100%" label="Views" icon="@Embed(source='assets/views-48x48.png')">
        <mx:TextArea text="Content" width="100%" height="100%"/>
      </mx:Canvas>
      <mx:Canvas width="100%" height="100%" label="Authors" icon="@Embed(source='assets/author-48x48.png')">
        <mx:TextArea text="Content" width="100%" height="100%"/>
      </mx:Canvas>
    </components:CollapsibleAccordion>
  </mx:HBox>
</mx:Application>