Skip to content

Instantly share code, notes, and snippets.

View JigarM's full-sized avatar
🏠
Working from home

Jigar M JigarM

🏠
Working from home
View GitHub Profile
@JigarM
JigarM / app.js
Created September 10, 2012 06:24 — forked from alexburner/app.js
Proof of Concept for Titanium implementation of Facebook/Path sidebar
Titanium.UI.setBackgroundColor('red');
// root
var rootWin = Ti.UI.createWindow({
title: 'Root Win',
backgroundColor: 'gray',
tabBarHidden: true,
navBarHidden: true
});
@JigarM
JigarM / app.js
Created September 21, 2012 21:49 — forked from aaronksaunders/app.js
Titanium Quickie: Facebook Album Covers Part 1
(function() {
var mainWindow, tableview;
function setupWindow() {
mainWindow = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
@JigarM
JigarM / qrscan.js
Created September 28, 2012 10:54 — forked from billdawson/qrscan.js
QR Code Scan Example from Marshall's "Developing Native Android Apps with Titanium" Webinar
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");
@JigarM
JigarM / activity1.js
Created September 28, 2012 10:55 — forked from vindriaoc/activity1.js
Native Titanium + Android example code
var activity = Ti.Android.currentActivity;
var win = Ti.UI.currentWindow;
activity.addEventListener("create", function(e) {
var button = Ti.UI.createButton({title: "Hello world"});
button.addEventListener("click", function(e) {
activity.finish();
});
win.add(button);
});
@JigarM
JigarM / app.js
Created September 30, 2012 11:23 — forked from skypanther/app.js
Draw gridlines in a Titanium window
// implement like this:
var window = Ti.UI.createWindow({
backgroundColor:'#fff'
});
// draw the gridlines first so your other elements stack on top of them
// without requiring you to set the z-index property of each
var grid = require('gridlines');
grid.drawgrid(10,window);
@JigarM
JigarM / TiYoutube.js
Created November 27, 2012 06:59 — forked from 19h/TiYoutube.js
Titanium Mobile SDK iPhone / Android: Extract Youtube Video URL / URI from video-id / identification / name and play mp4 file. (Workaround for the recent change of security in Youtube)
Titanium.App.addEventListener("playvideo", function (e) {
win11 = Titanium.UI.createWindow({
orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT],
title: "Video",
zIndex: 222222
});
var activeMovie = Titanium.Media.createVideoPlayer({
fullscreen: !0,
autoplay: !0,
@JigarM
JigarM / app.js
Created February 15, 2013 11:20 — forked from iskugor/app.js
function removeAllChildren(viewObject){
//copy array of child object references because view's "children" property is live collection of child object references
var children = viewObject.children.slice(0);
for (var i = 0; i < children.length; ++i) {
viewObject.remove(children[i]);
}
}
// get the collection object
Alloy.Collections.instance("Fugitive");
// delete all items
Alloy.Collections.Fugitive.deleteAll();
---
name: Titanium.UI
extends: Titanium.Module
methods:
- name: createListView
summary: creates a new instance of [View](Titanium.UI.ListView)
parameters:
- name: parameters
type: Dictionary<Titanium.UI.ListView>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.AndroidOrientation" android:versionCode="1"
android:versionName="1">
<uses-sdk android:minSdkVersion="8" />
<!-- TI_MANIFEST -->
<application android:icon="@drawable/appicon"
android:label="AndroidOrientation" android:name="AndroidorientationApplication"