Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
TitanUp is a library of utility functions for Titanium Mobile that provides
a number of custom views like GalleryView, ViewPager, SimplePicker, ModalView,
SelectBar, and utilities for building dynamic multi-density user
interfaces, managing themes, and window management.

Everything in TitanUp is designed to be cross-platform.  My Titanium philosophy
says that if you're not doing cross-platform development, why are you using
Titanium in the first place?  The way to maximize your benefit from the platform
is to go cross-platform. 

TitanUp relies on some third-party Titanium modules for a couple of its views:
  - DrawerMenuWM: Ti.DrawerLayout (
  - GalleryView: (optional) TiTouchImageView (

If you aren't using these classes, you don't need to install these modules.

This distribution includes a demo app that uses all the features of the
library, so it should be fairly apparent how to use it.

To use TitanUp, be sure to set your default unit to "dip" by adding this to
your tiapp.xml:

    <property name="ti.ui.defaultunit">dip</property>
The app will log a warning if you don't do this.

Class overview

 - uses best practices for battery management on android, ios
 - callbacks when distance changes by a specific amount

 - convenient place to define global variables

 - very simple wrapper for Ti.API.(trace|debug|info|warn|error) functions;
   keeps a circular buffer of log messages so that the runtime can access
   the logs for field diagnosis of problems

 - simple platform detection: ios/android (I find Titanium's functions
   cumbersome and inconsistent with their naming)
 - detect phone vs tablet
 - easy tests for key platform versions (iOS 7+, android 4+)

 - tracks pause/resume for android

 - centralized open/close window call that uses best practices for
   use with NavigationWindow on iOS; ties into TU.Context, monitors the
   depth of the window stack, integrates with window managers

 - prevents accidental double-firing of events on buttons (e.g. when you
   are opening a window in response to a button tap, the user might
   open two windows, which is obviously not intended)
 - hide/show navbar/actionbar convenience routines

 - centralized set of definitions for colors and fonts
 - routines for scaling fonts and adjusting luminance of colors

 - convenience functions for dp-to-px conversions
 - computes appropriate pixel size of UI elements based on display density

 - tab-group window manager

 - a "drawer menu" window manager (requires manumaticx's Ti.DrawerLayout module)
 - an "orientation aware" window that registers an event listener for
   the orientationchange event, removing the listener when the window is
   closed to prevent memory leaks; fires its own orientationchange event
   which can be safely listened to in your code
 - filters out faceup/facedown, which in my experience, are not very useful
 - allows you to hide the ActionBar/NavBar when in landscape mode; this is
   particularly useful in apps that have a mix of windows that are locked
   to portrait and windows that support portrait and landscape; on
   iOS, closing a window in landscape when the underlying window doesn't
   support landscape can cause some nastiness; by hiding the NavBar, you 
   can force the user to rotate the phone back to portrait before closing
   the window.
 - can call a layout callback when the window's rect has "settled"; during
   initialization and orientation change, you can get some weird rect values
   in the postlayout event listener; this filters out the noise so you can
   easily lay out your interface based on the real width/height

 - an image gallery view with a thumbnail view and a swipeable/zoomable
   full-size image view (zooming on android requires the 
   org.iotashan.TiTouchImageView module)

 - given a view, creates a modal overlay and displays the view

 - the standard ImageView does not fire events properly for remote images
   when ImageView is in a TableViewRow with touchEnabled=false;
   if your app needs to know that the image has been loaded, you can use
   this class instead; it isn't quite as smart as the ImageView, though --
   the standard ImageView is smart enough to delay loading images until
   the images are shown on screen.  RemoteImageView will attempt to load the
   images immediately.

 - a cross-platform group of selectable buttons

 - a cross-platform selection box with a popup list view

 - a cross-platform text field that supports padding on android (standard
   TextField doesn't support padding, leading to some ugly forms on android);
   not 100% compatible with standard TextField; see example code.

 - cross-platform viewpager (uses ScrollableView)


 - set default units to dip in tiapp.xml

 - LocationManager: instead of new TU.LocationManager, use 

 - Sizer: you don't need to use this much anymore; really only need it if you
   need to perform a calculation like "what size image file would I want
   to request from the server to fill a 300-dp ImageView at the display's
   native resolution?"


The TitanUp library for Titanium Mobile development




No releases published


No packages published