All Projects → appcelerator-developer-relations → Template.Hierarchical-Navigation

appcelerator-developer-relations / Template.Hierarchical-Navigation

Licence: other
Alloy App Template for apps that require hierarchical navigation, also known as parent-child or master-detail.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
CSS
56736 projects

Template.Hierarchical-Navigation

The Barebones template provides the necessary scaffolding to implement native hierarchical, also known as Parent-Child or Master-Detail, using platform-specific containers with content reusability, ensuring the best native user experience with high code reusability when required. Here's how it looks on iPhone, Android, iPad and Android Tablet:

  • Index.xml is platform specific and lives inside the iOS and Android folders
  • Index.js picks up the request, which "Requires" the "sharedhome" controller. This file is a single cross-platform controller used by all supported platforms. From here we can "talk" to the "sharedhome" files, effectively providing platform-specific containers with shared content

Important to keep in mind

This template project is using platform-specific folders to organize your main app containers and keep them in separate places. This practice is perfectly fine for the main container. For all other windows I recommend you keep your code in a single View file and use the platform attribute, for example:

<Alloy>
  <Window backgroundColor="#fff">

    <!-- this tag is Android-only -->
    <ActionBar platform="android" title="Window Title"/>

    <!-- this tag is iOS-only -->
    <Toolbar platform="ios" title="Window Title" top="20">
      <Items>
        <FlexSpace/>
        <Label id="wintitle">Window Title</Label>
        <FlexSpace/>
      </Items>
    </Toolbar>

  </Window>
</Alloy>

The same thing goes for your controllers, where you can use platform variables like:

if (OS_IOS){
  // do some iOS stuff
}else if (OS_ANDROID){
  // do some Android stuff
}

License

This code is licensed under the Apache Public License (Version 2).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].