Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 15:18 (UTC +02:00)
  • X @iskostja
View GitHub Profile
@IGx89
IGx89 / android_prefs
Created April 15, 2011 16:01
Emulates the standard Android preferences grid
// the following code is both the logic and examples of using it
var win = Titanium.UI.currentWindow;
// I've set anyDensity to true in my app and this function enables the UI to properly scale
// you can safely delete this function and all references to it if you'd like
var adj = function(pixels) {
if(Titanium.Platform.name == 'iPhone OS') {
return pixels;
} else {
@grantges
grantges / GLOSSARY.md
Last active January 26, 2016 14:23
Glossary for use with Appcelerator Platform related gitbooks.

Alloy

An MVC development framework built on top of Appcelerator Titanium for the purpose standardization of rapid application development. Alloy supports an abstracted view / controller paradigm for User Interface development seperating business logic from the graphical aspects of the mobile app, while also supplying a standardized mechanism for handling and binding data to the app and associated controllers.

API

Stands for Application Programming Interface which can be client side or server side functions which allow other programs to interact with the core features, gather data or perform business logic tasks and workflows on the underlying system.

APIs

The plural for API (Application Programming Interfaces)

Appcelerator Platform

@mcvendrell
mcvendrell / index.js
Created January 12, 2015 08:17
Titanium: How to re-use the launch image in the app (TiDev.io): Alloy style
// Animated start. Comments for code here: http://www.tidev.io/2015/01/06/how-to-re-use-the-launch-image-in-the-app
var img = Ti.UI.createImageView({
// Get the launch image
image: (function getImage() {
if (OS_IOS) {
// Working around orientation-bug
if (Ti.Platform.osname === 'ipad' || Math.max(Ti.Platform.displayCaps.platformWidth, Ti.Platform.displayCaps.platformHeight) === 736) {
return 'Default-' + (Ti.Gesture.isPortrait() ? 'Portrait' : 'Landscape') + '.png';
} else {
return 'Default.png';
var win = Ti.UI.createWindow({
backgroundColor: "#fff"
});
var refreshControl = Ti.UI.createRefreshControl({
tintColor: "red"
});
var scroll = Ti.UI.createScrollView({
backgroundColor: "yellow",
@exclusiveTanim
exclusiveTanim / app.js
Last active November 13, 2016 21:50
Marquee type animation
/*
Hello, I have tested this issue in Ti SDK 3.3.0.RC. Its working good.
Testing Environment:
Titanium SDK: 3.3.0.RC, 3.2.3.GA
Titanium CLI: 3.2.3
IOS Simulator 7.1
Appcelerator Studio, build: 3.3.0.201406271159
*/
@goodev
goodev / Manager.java
Last active November 17, 2016 19:41
fix Crouton the ActionBarOverlay problem
//change de.keyboardsurfer.android.widget.crouton.Manager class
// add this method below 'handleTranslucentActionBar()' method
private void handleActionBarOverlay(ViewGroup.MarginLayoutParams params, Activity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
final boolean flags = activity.getWindow().hasFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
if (flags) {
final int actionBarContainerId = Resources.getSystem().getIdentifier("action_bar_container", "id", "android");
final View actionBarContainer = activity.findViewById(actionBarContainerId);
// The action bar is present: the app is using a Holo theme.
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
*/
var TouchID = require("ti.touchid");
var win = Ti.UI.createWindow({
backgroundColor: "#fff",
@jasonkneen
jasonkneen / elements.js
Last active November 28, 2016 14:26
In the latest TiAlloy you can specify a module tag against the <Alloy> element in XML and this will be used when creating any elements in the view, so you can override, customise etc. The problem is if you want to use multiple commonJS libraries, there's no support in the Alloy Tag -- you'd have to change the module attribute for each element --…
var o = {};
// include the modules you want - purposely did this as seperate lines so it's easier to comment out modules etc
_.extend(o, require("module1"));
_.extend(o, require("module2"));
_.extend(o, require("module3"));
// make available under a single export for use in <Alloy> tag
module.exports = o;
@FokkeZB
FokkeZB / DOWNSIZE.md
Last active December 8, 2016 10:39
Automatically generate non-retina and Android images for Alloy projects

UPDATE: With the assets command of the TiCons CLI / Module this can be done even simpeler by calling $ ticons assets or an alloy.ymk using:

task("pre:load", function(event, logger) {
    require('ticons').assets();
});

@k0sukey
k0sukey / alloy.jmk
Last active December 8, 2016 10:44
Alloy built in underscore.js replace to lo-dash.js put your project folder app/assets/javascript/lodash.underscore.js
task("pre:compile", function(event,logger) {
logger.info('----- PRE:COMPILE -----');
});
task("post:compile",function(event,logger){
logger.info('----- POST:COMPILE -----');
var fs = require('fs'),
path = require('path'),
platform = event.alloyConfig.platform === 'ios' ? 'iphone' : event.alloyConfig.platform; // Resources/iphone