Samples in the advanced/ folder demonstrate advanced Alloy topics and approaches, such as advanced styling, using modules, using CommonJS modules, and more.
- Alloy Themes — This document demonstrates how to use Alloy themes to easily style your entire application UI for different platforms.
- CommonJS XML — Demonstrates using CommonJS modules to create UI components in an Alloy XML view.
- Complex Styling — Demonstrates how Alloy combines several TSS styles based on their priority.
- Custom TSS Queries — Demonstrates how to use custom TSS queries to style Alloy elements.
- Device Queries — Demonstrates how to combine platform and formFactor attribute selectors to apply different styles and properties on different platforms and device types.
- Dynamic Styling — Demonstrates different approaches to changing styles at runtime in Alloy. The sample application displays a menu of options that discuss or demonstrate the different approaches and techniques for dynamic styling. See each section below for a discussion of each approach.
- Form factor — Demonstrates how to conditionally apply TSS styles or include XML markup based on the form factor of the target device. Each XML element, or TSS style, can be assigned a formFactor attribute that can take a value of either "handheld" or "tablet".
- Handling Different Screen Densities on Android — Demonstrates how to package and use images for different screen densities on Android.
- Inheritance — Demonstrates how an Alloy controller can inherit functionality from another controller.
- Localization — Demonstrates how to use localized strings in your Alloy project.
- Master-Detail — Demonstrates how to create a master-detail application that presents a list of items from which the user can select to view details about that item.
- MomentJS — Demonstrates how to use the built-in Moment.js http://momentjs.com/ library in your Alloy application to format a date for different locales. Moment.js is a full featured date library for parsing, validating, manipulating, and formatting dates.
- Native Modules — Demonstrates using a native module in an Alloy application, in this case the Paint module provided by Appcelerator.
- Platform folders — Demonstrates how to structure an Alloy project with folders that contains platform-specific views.
- Proxy Property Requires — Demonstrates using Require and Widget elements to create Titanium proxy properties.
- Requiring Child Elements — Demonstrates how to use the
and elements to include external views and widgets. Also shows how to programmatically add child views declared inside a or element to the parent.
- Theming Widgets — Demonstrates how to apply themes to widgets. Theme settings override default styles and assets defined within the widget itself.