|
UI Catalog Tutorial: (1) Application Design with the ScreenStackApplication class
This tutorial explains all about the ScreenStackApplication class to design your ELIPS mobile app and get the best of each platform native navigation model. All examples are taken from the UI Catalog sample app that can be downloaded from there.
About Application Navigation ModelsA navigation model defines how the user interacts and navigates through the application screens. This covers many aspects as diverse as:
As a Mobile Application developer, complying with the targeted platform navigation model is mandatory if you want to secure user adoption and satisfaction. But this requires a specific expertise and additional development effort. About ScreenStackApplication Navigation ModelThe main purpose of the ScreenStackApplication class is for developers to rely on a single navigation model to design their ELIPS apps for the various platforms. The ELIPS application navigation model is then mapped "behind-the-scene" to the native navigation model of the targeted platform. In other words, by using the ScreenStackApplication class, your ELIPS application will automatically adapt to the iPhone navigation model once generated for iPhone and to the Android one once built for Android, all that with a single code-base! Using the ScreenStackApplication classThe ScreenStackApplication is the application container that embeds the unified ELIPS application model. It is a replacement for the <mx:application> and <mx:windowedapplication> tags, functioning as the entry point to an ELIPS application. All you need is to start your ELIPS Application with this container:
<mob:screenstackapplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:mob="openplug.elips.controls.*" xmlns:scr="openplug.elips.controls.screenClasses.*">
</mob:screenstackapplication>
Using the ScreenView classUse the ScreenView class, to define the screens within your application. A ScreenStackApplication typically contains several ScreenView objects, one per actual screen:
<mob:screenstackapplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:mob="openplug.elips.controls.*" xmlns:scr="openplug.elips.controls.screenClasses.*">
<mob:ScreenView id="Base"/> </mob:ScreenView> <mob:ScreenView id="Text"/> </mob:ScreenView> </mob:screenstackapplication> The Navigation from one screen to another can be achieved using the following function:
When going from one screen to another, the ScreenStackApplication stores the sequence in a so-called screen stack, enabling going back to a previous screen automatically (as you will see later) or programmatically, using such functions:
Using the TabNavigator classSome applications consist in several tab panes - one pane being displayed at a time. It could be the case of a basic utility app with a main pane and a settings pane. For such a case, the TabNavigator class can be used. A TabNavigator contains a collection of panes (consisting in child container objects) - each with a label and/or icon. A ToggleButtonBar object is automatically created for navigating between the panes.
<mob:ScreenView id="Base" clipContent="true" verticalScrollPolicy="auto">
<mob:TabNavigator id="mainTab" width="100%" height="100%"> <mx:VBox width="100%" height="100%" horizontalGap="0" verticalGap="0" icon="@Embed('main.png')"> <mx:Label text="UI Component Catalog"/> </mx:VBox> <mx:VBox id="helpBox" width="100%" height="100%" horizontalGap="0" verticalGap="0" icon="@Embed('info.png')"> <mx:Label text="Info"/> </mx:VBox> </mob:TabNavigator> </mob:ScreenView> Of course, your application can use a mix of "regular" ScreenView objects and TabNavigator-based views.
[iPhone] Using the NavigationBarDescriptor classThe NavigationBarDescriptor class can be used to add a top navigation bar for apps targeting the iPhone. The iPhone navigation bar typically displays a title - that can be defined using the "title" property - and a back button - that is handled automatically providing the screen stack. iPhone Navigation bar action buttons can also be set programmatically using the properties "leftAction" and "rightAction". Predefined NavigationBarDescriptor iPhone styles can be set using the "styleName" property with values "styleBlue" and "styleBlack".
<scr:NavigationBarDescriptor title="UI Catalog" id="baseNavBar" styleName="styleBlue"/>
To associate a NavigationBarDescriptor with a ScreenView object, use the "navBarDescriptor" property.
<mob:ScreenView id="Base" navBarDescriptor="{baseNavBar}"/>
[WinMob, Symbian] Using the SoftKeyBarDescriptor classThe SoftKeyBarDescriptor class can be used to add a navigation bar for apps targeting Windows Mobile and Symbian devices.
<scr:SoftKeyBarDescriptor id="backSoftKey" leftAction="Back" leftActionClick="goBack()"/>
To associate a SoftKeyBarDescriptor with a ScreenView object, use the "softKeyBarDescriptor" property.
<mob:ScreenView id="Text" softKeyBarDescriptor="{backSoftKey}"/>
To hide the soft key bar in a specific ScreenView object, use the "softKeyBarStatus" property.
<mob:ScreenView id="Base" softKeyBarStatus="none"/>
[Android] Using the MenuItem classThe MenuItem class can be used to add a menu items to the Android menu key for apps targeting Android-based devices. Menu items are typically displayed as a pop-up at the bottom of the screen when pressing the Android menu key. Menu items take a "label", an "icon" and an "actionClick" property and are combined in an array collection.
<mx:ArrayCollection id="menu1">
<scr:MenuItem actionClick="Alert.show('', 'About');" label="About" icon="@Embed('info.png')"/> </mx:ArrayCollection> To associate Android menu items with a ScreenView object, use the "menuProvider" property.
<mob:ScreenView id="Base" menuProvider="{menu1}"/>
ConclusionProviding the ELIPS ScreenStackApplication class, you can now make your application benefit from iPhone, Android and other platforms native navigation model, with a single code. For more information about UI Catalog, read the Resource and Variant Management in ELIPS Studio tutorial. |
Login
Commercial Release!
Apple updates the terms of the iOS developer agreement again, and it’s good for you - Read More...
Event: ELIPS Studio at FITC Mobile Toronto 17-18 September - Read More...
Alcatel-Lucent acquires OpenPlug: a message from our CEO - Read More...
Quick Links
|