Skip to content

Instantly share code, notes, and snippets.

View rajubd49's full-sized avatar

Md Harish Uz Jaman Mridha rajubd49

View GitHub Profile
@rajubd49
rajubd49 / app.js
Created April 16, 2015 07:49
ACS External Login - Appcelerator Titanium
var Cloud = require('ti.cloud');
var fb = require('facebook');
fb.appid = "appid";
fb.permissions = ['publish_stream', 'read_stream'];
var win = Ti.UI.createWindow({
title : "ACS Social Integrations"
});
var fbSignupBtn = Ti.UI.createButton({
@rajubd49
rajubd49 / app.js
Created April 16, 2015 07:52
Actual Size of an element - Appcelerator Titanium
var win = Ti.UI.createWindow();
var view=Ti.UI.createView({
width:Ti.UI.SIZE,
height:Ti.UI.SIZE,
backgroundColor:'#fff'
});
win.addEventListener('open', function(){
Ti.API.info('View Width:'+view.size.width + ', View Height:' + view.size.height);
@rajubd49
rajubd49 / app.js
Created April 16, 2015 08:01
AdMob Check-if received or not - Appcelerator Titanium
var Admob = require('ti.admob');
var adMobView = Admob.createAdMobView({
publisherId: "<<YOUR PUBLISHER ID HERE>>",
testing:false, // default is false
top: 0, //optional
left: 0, // optional
right: 0, // optional
bottom: 0, // optional
adBackgroundColor:"FF8800", // optional
@rajubd49
rajubd49 / app.js
Created April 16, 2015 08:08
Android menu if present or not -check - Appcelerator Titanium
var androidMenu=require('yy.hasmenu');
if (androidMenu.hasMenu) {
alert("Has a hardware button");
}
else {
alert("Uses a system bar, should probably add 48dp");
}
@rajubd49
rajubd49 / app.js
Created April 16, 2015 08:12
Android Navigating Windows - Appcelerator Titanium
var mainWin = Ti.UI.createWindow({
backgroundColor: "blue"
});
var btn = Ti.UI.createButton({
title: "Click",
width: 200,
height: 50,
backgroundColor: "#fff",
color: "#000"
});
@rajubd49
rajubd49 / app.js
Created April 16, 2015 08:19
Camera Switching and camera support checking - Appcelerator Titanium
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var aButton = Ti.UI.createButton({
title : 'Camera',
height : 50,
@rajubd49
rajubd49 / app.js
Created April 16, 2015 09:32
Change Image in click listener - Appcelerator Titanium
var win = Ti.UI.createWindow();
var like = Titanium.UI.createImageView({
image : '/image1.png',
left : 50,
top : 50,
height : 50,
width : 50
});
@rajubd49
rajubd49 / app.js
Created April 16, 2015 09:34
Email Attachment local file - Appcelerator Titanium
var win = Ti.UI.createWindow({
backgroundColor : "gray"
});
var btn = Ti.UI.createButton({
title : "open email dialogue",
top : 100,
left : 100,
height : 150,
width : 150
@rajubd49
rajubd49 / app.js
Created April 16, 2015 10:04
Fire an event from local HTML - Appcelerator Titanium
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var webView = Ti.UI.createWebView({
url:'/localHtml.html',
backgroundColor:'transparent'
});
win.add(webView);
Ti.App.addEventListener("appC", function(e) {
var win1 = Titanium.UI.createWindow({
@rajubd49
rajubd49 / app.js
Created April 16, 2015 10:14
Flip between views-iOS - Appcelerator Titanium
var state = true;
var window = Titanium.UI.createWindow({
backgroundColor: '#ffffff',
height: Ti.UI.FILL,
width: Ti.UI.FILL
});
var view = Ti.UI.createView({
top:165,
width:300,