This file contains 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
qrScanButton.addEventListener("click", function(e) { | |
var intent = Ti.Android.createIntent({ | |
action: "com.google.zxing.client.android.SCAN" | |
}); | |
intent.putExtra("SCAN_MODE", "QR_SCAN_MODE"); | |
var activity = Ti.Android.currentActivity; | |
activity.startActivityForResult(intent, function(e) { | |
if (e.resultCode == Ti.Android.RESULT_OK) { | |
var contents = e.intent.getStringExtra("SCAN_RESULT"); | |
var format = e.intent.getStringExtra("SCAN_RESULT_FORMAT"); |
This file contains 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
This gist is only for Android. | |
If you would like launch native apps | |
on iPhone, iPad, you can find information about it in Appcelerator Docs: | |
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html | |
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html | |
More info about iOS URL Schemes: http://handleopenurl.com/ |
This file contains 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
This gist is only for Android. | |
If you would like launch native apps | |
on iPhone, iPad, you can find information about it in Appcelerator Docs: | |
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html | |
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html | |
More info about iOS URL Schemes: http://handleopenurl.com/ |
This file contains 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
//"THE BEER-WARE LICENSE": As long as you retain this notice you can do whatever you want with this stuff. | |
//If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Jamie Buckley | |
var win = Ti.UI.createWindow({ | |
backgroundColor: 'black', | |
fullscreen: true, | |
width: Ti.Platform.displayCaps.platformWidth, | |
height: Ti.Platform.displayCaps.platformHeight | |
}); |
This file contains 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
//"THE BEER-WARE LICENSE": As long as you retain this notice you can do whatever you want with this stuff. | |
//If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Jamie Buckley | |
var screenWidth = Ti.Platform.displayCaps.platformWidth; | |
var screenHeight = Ti.Platform.displayCaps.platformHeight; | |
var win = Ti.UI.createWindow({ | |
fullscreen: true, | |
width: screenWidth, | |
height: screenHeight, |
This file contains 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
/* Window and View Styling */ | |
'.container': { | |
height: Ti.UI.FILL, | |
width: Ti.UI.FILL, | |
backgroundColor: 'white' | |
} | |
/* TabGroup styling */ | |
'#tabGroup':{ |
This file contains 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
/** | |
* | |
* this code was inspired by the work done by David Riccitelli | |
* | |
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
This file contains 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 win = Titanium.UI.createWindow({ | |
backgroundColor:'#fff' | |
}); | |
var webView = Ti.UI.createWebView({ url:'http://www.appcelerator.com', scalesPageToFit:true,setZoomScale:2, top:0, left:0}); | |
win.add(webView); | |
var firstTime = true; | |
var htmlHack = ''; | |
htmlHack += 'var element = document.createElement("meta");'; | |
htmlHack += 'element.name = "viewport";'; |
This file contains 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
/* | |
* An example of how to clean a window | |
* Mauro Parra-Miranda | |
* [email protected] | |
*/ | |
var win = Ti.UI.createWindow(); | |
var view = Ti.UI.createView(); | |
var label = Ti.UI.createLabel(); | |
var label2 = Ti.UI.createLabel(); | |
var image = Ti.UI.createImageView({ |