This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var returnData; // returned array of location data | |
| if (OS_IOS) { | |
| $.MapView.showAnnotations(annotationArray); | |
| } | |
| if (OS_ANDROID) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var image = logsData[i].image; | |
| var logImage = Ti.UI.createImageView({ | |
| image : image | |
| }); | |
| var tb = logImage.toBlob(); | |
| htmlPdfBuilder += '<img src="data:image/png;base64,' + Ti.Utils.base64encode(tb) + '" />'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toggleCheck(_event) { | |
| var items = _event.section.getItems(); | |
| for (var i = 0; i < items.length; i++) { | |
| var resetItem = _event.section.getItemAt(i); | |
| resetItem.properties.backgroundColor = Alloy.Globals.Device.brandColorBg; | |
| _event.section.updateItemAt(i, resetItem); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo gem uninstall cocoapods | |
| sudo gem install cocoapods | |
| sudo rm -fr ~/.cocoapods/repos/master | |
| pod setup | |
| pod install | |
| pod update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cals = require("permissions"); | |
| cals.addCalendarEvent({ | |
| iosEvent: { | |
| title: 'Sample Event', | |
| notes: 'This is a test event which has some values assigned to it.', | |
| location: 'Appcelerator Inc', | |
| begin: new Date(new Date().getTime() + 3000), | |
| end: new Date(new Date().getTime() + 900000), | |
| availability: Ti.Calendar.AVAILABILITY_FREE, | |
| allDay: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // function | |
| function showAnnotationsAndroid(_data) { | |
| var largestLat = Math.max.apply(Math, _data.map(function(o) { | |
| return o.latitude; | |
| })); | |
| var smallestLat = Math.min.apply(Math, _data.map(function(o) { | |
| return o.latitude; | |
| })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var termsText = L('terms_and_policy', 'No Translation'); | |
| if (OS_IOS) { | |
| var attr = Ti.UI.createAttributedString({ | |
| text : termsText, | |
| attributes : [{ | |
| type : Ti.UI.ATTRIBUTE_LINK, | |
| value : "terms", | |
| range : [termsText.indexOf('Terms of Use'), ('Terms of Use').length] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // check for updates | |
| appc setup | |
| // logout | |
| appc logout | |
| // login | |
| appc login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * function to check for all location services outcomes | |
| */ | |
| function requestLocationPermissions(authorizationType, callback) { | |
| // FIXME: Always returns false on Android 6 | |
| // https://jira.appcelerator.org/browse/TIMOB-23135 | |
| if (OS_IOS && !Ti.Geolocation.locationServicesEnabled) { | |
| return callback({ | |
| success : false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // install poedit https://poedit.net/ | |
| // install itstool | |
| brew install itstool | |
| // go into your language folder | |
| cd /Users/username/Documents/Appcelerator_Studio_Workspace/app/app/i18n/en | |
| // convert all & signs to & throughout your string.xml file else it fails |