Building Mobile Enterprise Applications : webMethods Mobile Development Help : Building the User Interface for a Mobile Application : Using Colors, Sizes, Styles and Themes : Using ApplicationStyle to Define Android Styles and Themes
Using ApplicationStyle to Define Android Styles and Themes
This section describes how to customize the Look and Feel of your Android application.
Note:  
Applies to Android only.
The ApplicationStyle allows you to define Styles and Themes for your Android project. In Android, a Style is a collection of properties that specify the look and format for a View. For more information about Android Styles and Themes, please refer to https://developer.android.com/guide/topics/ui/themes.html.
Please make sure your Application model contains an ApplicationStyle.
To define an ApplicationStyle for a mobile application
1. Ensure the Mobile Project is open in the Outline Editor. For instructions, see Displaying a Mobile Project in the Outline Editor.
2. In the Model section of the Outline Editor, expand the outline so that you view the Styles node.
3. Right-click the Styles node and select New Child > ApplicationStyle.
The ApplicationStyle node provides a child called Android Theme. You can add a Android Theme by right-clicking the ApplicationStyle node and selecting New Child -> Android Theme. After adding an Android Theme to the Application Style, a new editor opens showing all the defined styles and themes. You will find the corresponding themes.asl file in your <project>/model/resources/ directory.
Note:  
A Mobile Project can only contain one Android Theme file.
A project created with Mobile Suite 9.12 already contains an Android Theme with default values set. Projects created with versions of Mobile Suite before 9.12 take these values as defaults as well:
values {
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark">
</style>
<style name="ToolbarPopupTheme" parent="ThemeOverlay.AppCompat.Light">
</style>
}

values-v14 {
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
</style>
}
The editor allows editing of Styles and Themes in a way familiar to Android developers: in a XML-based language. Developers can group a collection of Styles within a Values category. The values category can contain an optional resource qualifier, stated by the suffix "-qualifier", e.g. "values-v14". For more information about Android resource qualifiers, please refer to https://developer.android.com/guide/topics/resources/providing-resources.html. In Android, each style can contain a set of items (https://developer.android.com/guide/topics/resources/style-resource.html).
You can customize the theme of an Android project by adding the style named "AppBaseTheme" to your Values category. Please note that themes are limited to AppCompat, e.g. Theme.AppCompat.Light, Theme.AppCompat and Theme.AppCompat.DayNight.
After code generation, an XML file is created for each of your Values categories. Generated files are placed in the <project>/gen/.assets/android/res directory. Each of the Values categories will land in a directory named after the category itself, e.g. /values-v14. This directory contains a single styles.xml file containing your declared styles and themes. During the multi build, the entire content of the <project>/gen/.assets/android/res directory will be copied to the cross compiled Android project.
Copyright © 2007-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback