Skip to content

Instantly share code, notes, and snippets.

@FokkeZB
FokkeZB / app.js
Last active August 29, 2015 14:06
addEventListenerOnce
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
win.addEventListener('click', function foo(e) { // note the named function expression needed for the second way
// oringal idea by @fukhaos
// http://www.tidev.io/2014/09/10/the-case-against-ti-app-fireevent-2/#comment-13013
e.source.removeEventListener(e.type, arguments.callee);
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@ricardoalcocer
ricardoalcocer / themes.md
Last active October 15, 2021 08:10
Changing Android ActionBar Theme and Android Style

Customizing the overall App Style

This guide has been updated for Titanium SDK 3.3.0 which uses AppCompat to bring the ActionBar to Android 2.3.x

Android has a build-in theming system. Using this feature you can easily change the base color Android uses for its controls across your app, allowing you to provide better branding and personalization, while maintaining Android's UI and UX.

Android built-in themes are:

  • Holo (Mostly Black and Cyan)
  • Holo Light (Mostly White and Gray)
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@tonylukasavage
tonylukasavage / app.tss
Created July 16, 2013 14:49
TSS reset for Alloy/Titanium
'Label[platform=android]': {
color: '#000' // all platforms except Android default to black
}
'Window': {
backgroundColor: '#fff' // white background instead of default transparent
}
'Window[platform=android]': {
modal: false // make android windows all heavyweight
@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

@alanleard
alanleard / app.js
Last active July 19, 2016 13:21
Understanding how backgroundLeftCap and backgroundTopCap work in Titanium
//This is a demo to show how backgroundLeftCap and backgroundTopCap work on the Tianium platform by Appcelerator
//Paste this code in app.js (tested on iOS)
//Screenshot: http://screencast.com/t/txWQD3l2UBN
///////////////////////////////////////////////////////////////////////////////
//Just modify these variables to see how backgroundLeftCap and topCap will work
var topCap = 20;
var leftCap = 35;
var originalImageSize = {height:100, width:100}
@yagitoshiro
yagitoshiro / gist:1247519
Created September 28, 2011 09:54
Titanium Mobile (Android) sample -- save file to sdcard and register to photo gallery.
save_button.addEventListener('click', ()->
if Ti.Filesystem.isExternalStoragePresent
save_image = Ti.Filesystem.getFile(path).read()
new_path = Titanium.Filesystem.externalStorageDirectory + Date.now().toString() + ".png"
f = Ti.Filesystem.getFile(new_path)
result = f.write(save_image)
unless result
return null