Skip to content

Instantly share code, notes, and snippets.

View FokkeZB's full-sized avatar
*️⃣
Zappin'

Fokke Zandbergen FokkeZB

*️⃣
Zappin'
View GitHub Profile
@FokkeZB
FokkeZB / index.xml
Created January 21, 2014 18:13
Need a Window on IOS but a View on Android in Alloy?
<Alloy>
<Window module="xp.ui">
<Label>Hello World</Label>
</Window>
</Alloy>
@FokkeZB
FokkeZB / README.md
Last active June 13, 2017 20:28
How to have a dynamic Android menu or action bar for tab groups in Titanium 3.x?
@FokkeZB
FokkeZB / README.md
Created September 20, 2013 09:38
URL schemes for iOS and Android (2/2)
@FokkeZB
FokkeZB / app.tss
Last active December 22, 2015 23:29
The iOS7 bordered button (like found in AppStore) for iOS6
".btn": {
borderSize: 1,
borderColor: '#1881f9',
borderRadius: 3,
color: '#1881f9',
selectedColor: '#1881f9',
height: 26,
style: Ti.UI.iPhone.SystemButtonStyle.PLAIN,
font: {
fontSize: 15,
@FokkeZB
FokkeZB / alloy.js
Last active August 13, 2016 17:28
Quick #TiAlloy fix for windows being positioned under the status bar on #iOS7
// For iOS7 only, set the window's top to 20 so they start under the status bar.
Alloy.Globals.windowTop = (OS_IOS && parseInt(Ti.Platform.version[0], 10) >= 7) ? 20 : 0;
@FokkeZB
FokkeZB / shell
Last active October 30, 2017 18:39
Get the Key Hash for Titanium's develoment keystore (replace 3.1.3.GA with your version), required for the Facebook SDK (https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android) and the SHA1 fingerprint for the Google Cloud API's (pw: tirocks).
keytool -exportcert -alias androiddebugkey -keystore ~/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/android/dev_keystore | openssl sha1 -binary | openssl base64
keytool -exportcert -alias androiddebugkey -keystore ~/Library/Application\ Support/Titanium/mobilesdk/osx/3.1.3.GA/android/dev_keystore -list -v
@FokkeZB
FokkeZB / app.js
Created August 28, 2013 08:32
Need to run/skip code only when ran via TiShadow?
// Add do your app.js or alloy.js
Ti.Shadow = (typeof __p === 'object');
// Use it anywhere
if (OS_IOS && !Ti.Shadow) {
require('dk.napp.testflight').takeOff(Alloy.CFG.testFlightToken);
}
@FokkeZB
FokkeZB / README.md
Last active April 6, 2020 14:57
URL schemes for iOS and Android (1/2)
@FokkeZB
FokkeZB / app.js
Created August 22, 2013 09:54
How to know if your Android device is LONG or NOTLONG?
http://developer.android.com/guide/topics/resources/providing-resources.html#ScreenAspectQualifier
if ((Ti.Platform.displayCaps.platformWidth / Ti.Platform.displayCaps.platformHeight) < (((Ti.Gesture.orientation === Ti.UI.LANDSCAPE_LEFT)) ? (320 / 240) : (240 / 320)))) {
Ti.API.info('I am LONG');
} else {
Ti.API.info('I am NOTLONG');
}