Library, helpers, toolkits, etc
Hello all,
With a great active Ti development community, I was wondering if anyone would be interested in sharing some common libraries, utility objects, etc. I'd love to get something started as I know everyone is probably doing the same thing over and over again in build great Ti apps. I would be interested in hearing some feedback on this front.
-James
4 Answers
-
Yes. I think it is a good idea and I have code that I would donate to the cause.
-
sendEmail = function(subject, message) { // email var emailDialog = Titanium.UI.createEmailDialog(); if (!emailDialog.isSupported()) { Ti.UI.createAlertDialog({ title:'Error', message:'Email not available' }).show(); return; } emailDialog.setSubject(subject); //emailDialog.setToRecipients(['foo@yahoo.com']); //emailDialog.setCcRecipients(['bar@yahoo.com']); //emailDialog.setBccRecipients(['blah@yahoo.com']); if (Ti.Platform.name == 'iPhone OS') { emailDialog.setMessageBody(message); emailDialog.setHtml(true); emailDialog.setBarColor('#336699'); } else { emailDialog.setMessageBody(message); } emailDialog.addEventListener('complete',function(e) { if (e.result == emailDialog.SENT) { if (Ti.Platform.osname != 'android') { // android doesn't give us useful result codes. // it anyway shows a toast. Ti.UI.createAlertDialog({ title:'<APP TITLE>', message:'Email successfully sent!' }).show(); } } else { if (e.result != 0) { Ti.UI.createAlertDialog({ title:'Erro', message:"The email has not been sent." }).show(); } } }); emailDialog.open(); };
-
// Show error dialog. showError = function(msgText) { var statusAlert = Titanium.UI.createAlertDialog({title:"Error",message:msgText}); statusAlert.show(); };
-
very interesting topic! well done, i will try to add something as well.