Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 06:47 (UTC +02:00)
  • X @iskostja
View GitHub Profile
var isGenymotion = Ti.Platform.name === 'android' && Ti.Platform.manufacturer === 'Genymotion';
'Window[platform=android]': {
windowSoftInputMode: Ti.UI.Android.SOFT_INPUT_STATE_HIDDEN
}
@kbshl
kbshl / adb_install_compiled_app_in_titanium.sh
Last active November 18, 2016 16:28
Adb install already compiled Android app in Titanium - From http://skypanther.com/2015/10/arggh-failed-android-install
# the -r flag says to reinstall app and is not really necessary but does not hurt
# so throw it in
adb install -r /path/to/your_app/build/android/bin/YourApp.apk
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>myinsecuresite.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
// right way:
var file = Titanium.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filename);
file.write(imageBlobData);
// save only the file's name
myModel.set('filepath', filename);
myModel.save();
// then this will work even after an upgrade
@kbshl
kbshl / align_view_at_bottom_within_framelayout.java
Created November 18, 2016 14:38
Set Layout Gravity Programmatically or rather align view at bottom of parent FrameLayout - Source: ((FrameLayout.LayoutParams) view.getLayoutParams()).gravity = Gravity.BOTTOM;
((FrameLayout.LayoutParams) view.getLayoutParams()).gravity = Gravity.BOTTOM;
// or on FrameLayout.LayoutParams creation
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width != 0 ? width : FrameLayout.LayoutParams.MATCH_PARENT, height, Gravity.BOTTOM);
ViewGroup rootViewGroup = (ViewGroup) activity.getWindow().getDecorView().findViewById(android.R.id.content);
@kbshl
kbshl / install_npm_package_from_github.sh
Created November 4, 2016 16:14
How to install NodeJS package from Github directly
# https
git+https://git@github.com/visionmedia/express.git
# ssh
git+ssh://git@github.com/visionmedia/express.git
@kbshl
kbshl / README.md
Created October 26, 2016 11:18
Toolbar with Appcelerator Titanium and Drawer Layout Module

Toolbar with Appcelerator Titanium and Drawer Layout Module

This is an example of how to activate the Toolbar for the Drawer Layout Module and create a Drawer Layout which overlaps the Android Actionbar respectively the Toolbar.

How this works

It is actually not the hardest work to get it to work. All happens through Android Theming and the correct tiapp.xml / Window configuration.

License

// escape it with square brackets
moment().format('MMM. D, YYYY [at] h:mm A z');
// produces: "Jan. 30, 2015 at 2:46 PM "