Release 1.7.8
Alloy 1.7.8 is a minor release that includes new features and multiple bug fixes. Alloy 1.7.8 is shipped with Appcelerator Core Package v5.0.0.
See the Full list of Issues that were addressed in Release 1.7.8.
New Features
Track Event Listeners on a View-Controller
Alloy now tracks all Titanium event listeners set in XML, for example, <Button onClick="myFn">
. Use the following APIs to manipulate the tracked event listeners:
$.addListener()
: Add a tracked event listener to a view proxy object$.getListener()
: Retrieve tracked event listeners$.removeListener()
: Remove tracked event listeners
Use a Test Application to Create a New Alloy Project
Add the --testapp <PATH_TO_TESTAPP>
option to the alloy new
command to create a new project based off an Alloy test application.
Pass the option the relative path to the test application after the alloy/test/apps
path.
For example, if you want to use the picker test application, run alloy new --testapp ui/picker
from a skeleton Titanium project.
Copy, Move or Delete View-Controllers
Add CLI commands to copy, move or delete view-controllers from the project, which includes the controller, XML and TSS files.
alloy copy <controller_name> <copy_name>
: Copy a view-controlleralloy move <controller_name> <new_name>
: Rename a view-controlleralloy delete <controller_name>
: Delete a view-controller
Themes Enhancement
Themes now support i18n
, lib
and platform
folders for theme-specific localized assets, CommonJS modules and platform-specific assets, respectively.
TSS and XML Markup Enhancements
- Support setting XML attributes to
Alloy.CFG
andAlloy.Globals
values. - Support the
module
attribute in theAlloy
element to set a defaultmodule
attribute for all elements in the XML view. - Support <CommandBar/> as a child tag of the <Window> object to add a command bar to a Window. Add an <Items/> tag as a child of the
CommandBar
element, then add <AppBarButton/>, <AppBarToggleButton/> and <AppBarSeparator/> tags as children of theItems
element to add buttons to the command bar. Only supports the Windows platform. - Support <AttributedString/> tag as a child of the
Label
,TextArea
andTextField
elements to set theattributeString
property, and the <AttributedHintText/> tag as a child of theTextField
element to set theattributedHintText
property. SearchView
element is now implicitly assigned to theTi.UI.Android
namespace, that is, <SearchView/> is the same as <SearchView ns="Ti.UI.Android"/>.- Support in custom queries to use local functions defined in the controller and arguments passed to the
Alloy.createController()
method. To reference arguments passed to the controller, use the$.args
variable. Previously, you could only reference properties and functions in theAlloy.Globals
namespace. For details, see Custom Query Styles.
Widget Enhancements
Widgets now support the i18n
directory for localized assets.
API Changes
New APIs
API | Type | Note |
---|---|---|
Alloy.Controller.addListener |
method | Add a tracked event listener to a view proxy object. |
Alloy.Controller.getListener |
method | Retrieve tracked event listeners. |
Alloy.Controller.removeListener |
method | Remove tracked event listeners. |