Skip to end of metadata
Go to start of metadata

Samples in the advanced/ folder demonstrate advanced Alloy topics and approaches, such as advanced styling, using modules, using CommonJS modules, and more. 

  • Alloy ThemesThis document demonstrates how to use Alloy themes to easily style your entire application UI for different platforms.
  • CommonJS XMLDemonstrates using CommonJS modules to create UI components in an Alloy XML view.
  • Complex StylingDemonstrates how Alloy combines several TSS styles based on their priority.
  • Custom TSS QueriesDemonstrates how to use custom TSS queries to style Alloy elements.
  • Device QueriesDemonstrates how to combine  platform  and  formFactor  attribute selectors to apply different styles and properties on different platforms and device types.
  • Dynamic StylingDemonstrates 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 factorDemonstrates 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 AndroidDemonstrates how to package and use images for different screen densities on Android.
  • InheritanceDemonstrates how an Alloy controller can inherit functionality from another controller.
  • LocalizationDemonstrates how to use localized strings in your Alloy project.
  • Master-DetailDemonstrates 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.
  • MomentJSDemonstrates how to use the built-in Moment.js 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 ModulesDemonstrates using a native module in an Alloy application, in this case the Paint module provided by Appcelerator.
  • Platform foldersDemonstrates how to structure an Alloy project with folders that contains platform-specific views.
  • Proxy Property RequiresDemonstrates using Require and Widget elements to create Titanium proxy properties.
  • Requiring Child ElementsDemonstrates 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 WidgetsDemonstrates how to apply themes to widgets. Theme settings override default styles and assets defined within the widget itself.