Skip to content

Instantly share code, notes, and snippets.

View sumitk's full-sized avatar
🎯
Focusing

Sumit Kataria sumitk

🎯
Focusing
View GitHub Profile
@sumitk
sumitk / SapTitanium.js
Created August 22, 2012 15:43 — forked from mschmulen/SapTitanium.js
Connect to SAP via NetWeaver Gateway oData in a Titanium app using Appcelerator SAP Module
var uiODataSimple = (function() {
var API = {};
API.DataJS = require('ti.sap.odata');
API.collectionCache = null;
API.useXMLNotJSON = true;
API.dataType = API.useXMLNotJSON ? 'application/atom+xml' : 'application/json';
API.queryString = '=xml';
@sumitk
sumitk / app.js
Created July 23, 2012 13:48
Calendar Titanium Module for iOS example
/*
* Basic UI setup
*/
var win = Ti.UI.createWindow({
backgroundColor:"white",
layout:"vertical"
});
var label = Ti.UI.createLabel({
text:"press the button to add an event",
@sumitk
sumitk / RecordingVideo.js
Created July 21, 2012 14:39 — forked from dawsontoth/RecordingVideo.js
How to record video, then share or save it. Using Appcelerator Titanium!
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html
*/
/**
* First, create our UI. We'll have two buttons: record, and share.
*/
var win = Titanium.UI.createWindow({
@sumitk
sumitk / HintTextArea.js
Created July 3, 2012 09:36 — forked from dmarcelino/HintTextArea.js
A Titanium Mobile implementation of a TextArea with hintText compatible with iOS
/**
* @author Dario Marcelino
*/
var defaultHintTextColor = 'gray';
var filter = function (/*Object*/ source){
var newObj = {};
for(name in source){
@sumitk
sumitk / Indicator.js
Created April 27, 2012 18:56 — forked from Mode54/Indicator.js
Titanium Mobile indicator module (iOS only so far)
var isIndicatorOpen = false,
view = Ti.UI.createView({
backgroundColor : "#000",
borderRadius : 10,
opacity : 0.8
}),
// message
message = Ti.UI.createLabel({
color : "#fff",
width : "auto",
/**
* @preserve
* Titanium Cloud Module
*
* This module is used across three distinct platforms (iOS, Android, and Mobile Web), each with their own architectural
* demands upon it.
*
* Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
* and licensed under the Apache Public License (version 2)
*/
@sumitk
sumitk / app.js
Created October 7, 2011 19:32 — forked from Mindelusions/app.js
LeatherFace Application Code
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup({
backgroundImage:'/images/tabbar.png'
});
// Component Creation
@sumitk
sumitk / pull-to-refresh(android).js
Created September 27, 2011 22:11 — forked from jpurcell/pull-to-refresh(android).js
Tweetie-like pull to refresh and pull to load more. Note that it requries set heights for everything.
// This is the Android version of the Tweetie-like pull to refresh table:
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
var win = Ti.UI.currentWindow;
var alertDialog = Titanium.UI.createAlertDialog({
title: 'System Message',
buttonNames: ['OK']
});
var scrollView = Ti.UI.createScrollView({
var currentData = new Array();
var requestAgain = true;
var xhr = Titanium.Network.createHTTPClient();
var returnedData;
var timeDelay = (2 * 60 * 1000); // 2 mins * 60 seconds * 1000 milliseconds
// Setup our event handlers
xhr.onload = function() {
// This gets first one receipt of the data
returnedData = this.responseText;