Components

PLEASE NOTE THIS TEXT IS UNDER DEVELOPMENT. MOST PROPERTIES ARE NOT DOCUMENTED YET. PLEASE, REFER TO THE EXISTENT EXAMPLES TO SEE HOW TO USE THEM

Alloy Widgets

widgets franky 1

widgets franky 2

widgets form settings

widgets form signup

com.criteriastudio.RemoteImageView

An image view that downloads and automatically manages its own cache. Also works with local images.

It also adds properties to the image, doing it zoomable, it is, click for view fullscreen and pinch for zoomin.

Features:
– manages its own local cache
– shows a loading indicator with progress while loads a remote picture
– set zoomable property to true open a new window with a zoomable fullscreen image, showing an small loupe icon
– Support for retina images after saving in cache
– Also works with local images

ti.ux.alignview

Distributes horizontally all children elements added in its creation.

If no width property is set, it takes the parent width. You can set width property if the view is smaller than the parent or if the parent view is a
scrollView where you want to align all the elements.

ti.ux.expandabletext

A clickable label that expands its size. Properties accepted:

height

Uses style paragraph

ti.ux.image

this component envelopes com.criteriastudio.RemoteImageView widget for easier management.
Also adds vertical parallax FX to it.

Use innerMargin to set the limits of the parallax fx. Use realTop property indicating the real from the window top edge. This is required to correctly manage
the scroll event by the parent container (tipically a table view or a scrollview)

ti.ux.forms.row.optionspicker

Extends TableViewRow to be used in a settings form. Clicking on it, opens a selector of options.

Properties:

title: Title to show in the row
options : array of string with the options to show to the user
type: Type of dialog to show. optionsdialog | popup | modalwindow //modal window not implemented yet
value: index of the selected value by default
cancel: cancel option index in options (optional)

ti.ux.forms.row.switch

Extends TableViewRow to be used in a settings form. Adds a switch and a title to the row

Properties:

title: Title to show in the row
value : true | false Default value for the switch

ti.ux.forms.row.text

Extends TableViewRow to be used in a settings form. Adds a text field to the form

Properties:

title
hintText
type: text|email|url|number|textarea
value

If textarea is used in type property, a modal window opens with a big text area when the control receives the focus.

Email, url, number and so on uses their own validators and customizes the keyboard

ti.ux.forms.row.timepicker

Extends TableViewRow to be used in a settings form. Shows a datepicker.

Properties:

title
value
minDate
maxDate
format: format used in the value field

If textarea is used in type property, a modal window opens with a big text area when the control receives the focus.

Email, url, number and so on uses their own validators and customizes the keyboard

ti.ux.forms.scrollableform

<Widget src="ti.ux.forms.scrollableform" id="form"></Widget>

Creates a form assistant (each field in one scrollable view). Initialize the widget with a json data structure,
indicating the fields to create, properties for each field, callback methods (in case it is cancelled or validated).

A validation method is automatically assigned to each field depending on its type property. A custom validator method
can be declared for each field.

Declaring a type customizes the keyboard, passwordMask and validator method. Supported types are:

text
password
email
phone
number
url

Default type is text

This is an example of json form data:

To create the form, just call it in you onOpen window event:

About validators

Validators may include or not a callback function. A callback function can be useful when the validation requires
a remote connection (for example, to check if a username already exists). If a callback function is used, an
activityIndicator is shown during the validation.

Have a look to lib/validators.js to see a few examples of validators.

ti.ux.forms.text

A boxed label and textfield with validation methods. Includes a title above the textfield. Thought to be used in scrollable step-by-step forms.

ti.ux.iconbutton

A button that accepts FontAwesome 4.1.0 codes. Fully customizable.

Properties:

icon
size
iconColor

ti.ux.iconfont

A label that accepts FontAwesome 4.1.0 codes codes

icon the font awesome icon code
iconColor
size

ti.ux.iconlabel

An icon with a label besides it. The icon can be an image, using image property or a
FontAwesome 4.1.0 codes code using icon property.

ti.ux.iconvalue

An icon with a label below it. The icon can be an image, using image property or a
FontAwesome 4.1.0 codes code using icon property.

ti.ux.pagingcontrol

A paging control that can be embebbed to any scrollable view and stylized in style files.

The widget can be declared in Alloy in the xml view file, but must be initialized in code, after the scrollable view is drawn.

In the controller

This is an example of pagingControl styling:

Note that the pagingControl can be in or outside the scrollable control.

ti.ux.rowitem

A TableViewRow widget, that accepts title, subtitle and count properties.

ti.ux.popup

A customizable fullscreen popup window, to add any content to it.

use closeButton to show a cross button in the top right corner of the content. The popup also can be dismissed touching the background.

to show the popup

ti.ux.popup.list

ti.ux.popup.list widget

A customizable fullscreen popup list to show a closed list of options.

closeButton shows a cross button in the top right corner
selectable determines if the items in the list are selectable (use false for showing a list of items)
options array of strings, each element is an item in the list
value selected item in the list (only if selectable is true)

You can define the popup in the alloy view or inside the controler in runtime.

This example shows how to declare a selectable list and retrieve the selected option

ti.ux.scrollableview

A Titanium ScrollableView with customizable pagingControl through alloy styles.

ti.ux.spacer

A white space widget to leave blank spaces between rows or components.

ti.ux.title

A title label styling class label-H1

Credits

Dreamed up by Sonia Villanueva and Javier Rayon in 2014.

UX strategy and mock-ups by Sonia

Titanium code and documentation by Javier

Themes designs and extra energy push by Mai Berreando. She gift some of the coolest designs we have seen, among some beautiful cactus. ;)

We use the incredible work and technology done by:

Orignal FontAwesome Titanium module by Kosuke Isobe

License

All parts of this project are fully open source and is GPL friendly. You can use it for commercial projects, open source projects,
or really just about whatever you want.

Attribution is not required, but appreciated. Among anything else, we will love to know what you did with our work.