Skip to content

Instantly share code, notes, and snippets.

View csemrm's full-sized avatar

Mostafizur Rahman csemrm

View GitHub Profile
@csemrm
csemrm / app.js
Created December 15, 2013 13:46
Image display form Picasa photo in Titanium
var win = Ti.UI.createWindow({
backgroundColor : '#fff',
layout : 'vertical',
navBarHidden : false,
title : 'Show Photo From Fhoto Galary'
});
var url = "https://picasaweb.google.com/data/feed/base/user/115403892804643478218?alt=rss&kind=album&hl=en_US&imgmax=1600";
var xhr = Ti.Network.createHTTPClient({
onload : function() {
@csemrm
csemrm / Mn_LoginOnBoarding1View.js
Created December 14, 2013 13:22
iPhone 5 Assets To use assets specific to the new iPhone 5 screen (1136 x 640 pixels), add the suffix -568h@2x to the asset filename, for example, Resources/iphone/myimage-568h@2x.png. Previously, only the splash screen file, Default.png, supported this suffix.
function LoginOnBoarding1View() {
var iphone5Flag = false;
if (Ti.Platform.displayCaps.platformHeight === 568) {//iphone 5
iphone5Flag = true;
}
//create component instance
var self = Ti.UI.createImageView({
left : 0,
@csemrm
csemrm / app.js
Created December 14, 2013 04:45
How to write multi-lingual script in Titanium? Step to use: 1. Create a titanium project 2. Update app.js file with my code 3. Create new folder "i18n" in project root directory if not exits 4. Add another folder "like en" your language 5. Add new file string.xml and update my code 6. Now ready to use
var win = Ti.UI.createWindow({
layout : 'vertical',
backgroundColor : '#fff'
});
var aLabel = Ti.UI.createLabel({
text : L('hello'),
});
win.add(aLabel);
@csemrm
csemrm / app.js
Last active May 19, 2016 17:48
File upload to the server using Titanium Test environment: Ti SDK 3.1.3.GA, CLI 3.2.0
(function() {
var form_url = 'http://apps.priyo.com/jonopriyo/image.php';
var win = Ti.UI.createWindow({
layout : 'vertical',
backgroundColor : '#fff'
});
var btnPhoto = Ti.UI.createButton({
title : 'Select Photo'
@csemrm
csemrm / app.js
Created December 3, 2013 11:54
Lock window screen in Portrait Android For Android Window screen lock, we need to set orientationModes and orientation property in the window object. we also need to make sure you force a heavyweight window by either setting fullscreen: true or navBarHidden: true.
var win = Titanium.UI.createWindow({
title : 'My app',
backgroundColor : '#fff',
navBarHidden : true,
orientationModes : [Titanium.UI.PORTRAIT]
});
Titanium.UI.orientation = Titanium.UI.PORTRAIT;
var testButton = Ti.UI.createButton({
title : 'Test Button',
@csemrm
csemrm / app.js
Created December 2, 2013 13:13
TableView inside ScrollView with pinch event
var win = Ti.UI.createWindow();
win.title = "Test";
var table = Ti.UI.createTableView({
top : 30
});
var scrollView = Ti.UI.createScrollView({
backgroundColor : '#fff',