Skip to content

Instantly share code, notes, and snippets.

@cathandnya
Created February 25, 2013 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cathandnya/5028411 to your computer and use it in GitHub Desktop.
Save cathandnya/5028411 to your computer and use it in GitHub Desktop.
AutoPushButton #titanium
var AutoPushButton = function(params) {
var self = Ti.UI.createButton(params);
if (Ti.Platform.osname == 'android' && !(self.selectedBackgroundImage != null)) {
self.addEventListener('touchstart', function() {
this.opacity = 0.8;
});
self.addEventListener('touchend', function() {
this.opacity = 1.0;
});
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment