This repository has been archived by the owner on Jan 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Titanium Shortcuts
wGEric edited this page Sep 30, 2011
·
4 revisions
TiQuery provides many shortcuts for Titanium methods.
Below are the ways to do it in Titanium and the equivalent methods in TiQuery. The arguments are the same as they are for Titanium. See Titanium's Documentation for more information.
Titanium Code
Titanium.API.info('string');
Titanium.API.error('string');
Titanium.API.warn('string');
Titanium.API.log('level', 'string');
TiQuery
$.log('string');
$.error('string');
$.warn(string);
$.log('level', 'string');
There are shortcuts for just about every create* method that can be found in Titanium. The TiQuery equivalent methods take the same arguments as Titanium. Here are some more popular ones:
Titanium
Titanium.UI.createView();
Titanium.UI.createLabel();
Titanium.UI.createWindow();
Titanium.UI.createScrollView();
Tianium.Media.createVideoPlayer();
TiQuery
$.View();
$.Label();
$.Window();
$.ScrollView()
$.VideoPlayer();
NOTE: Titanium optimizes which classes it includes so that only those that you are using are included in the build. If you use the shortcuts below you'll need to tell Titanium to include these classes. You can do this by putting code like this in app.js
// make sure Titanium includes these classes when it builds the project
Titanium.UI.view;
Titanium.Media.VideoPlayer;
Here is the complete list of shortcuts:
- $.BroadcastIntent();
- $.Intent();
- $.IntentChooser();
- $.Notification();
- $.PendingIntent();
- $.Service();
- $.ServiceIntent();
- $.Annotation();
-
$.MapView(); In Titanium it is
Titanium.Map.createView()
.
-
$.2DMatrix(); Note: Must be called like
$['2DMatrix']()
because functions can't start with a number in Javascript. -
$.3DMatrix(); Note: Must be called like
$['3DMatrix']()
because functions can't start with a number in Javascript. - $.ActivityIndicator();
- $.AlertDialog();
- $.Animation();
- $.Button();
- $.ButtonBar();
- $.CoverFlowView();
- $.DashboardItem();
- $.DashboardView();
- $.EmailDialog();
- $.ImageView();
- $.Label();
- $.OptionDialog();
- $.Picker();
- $.PickerColumn();
- $.PickerRow();
- $.ProgressBar();
- $.ScrollView();
- $.ScrollableView();
- $.SearchBar();
- $.Slider();
- $.Switch();
- $.Tab();
- $.TabGroup();
- $.TabbedBar();
- $.TableView();
- $.TableViewRow();
- $.TableViewSection();
- $.TextArea();
- $.TextField();
- $.Toolbar();
- $.View();
- $.WebView();
- $.Window();