Skip to content

Instantly share code, notes, and snippets.

@sivagao
Created February 27, 2013 18:32
Show Gist options
  • Select an option

  • Save sivagao/5050320 to your computer and use it in GitHub Desktop.

Select an option

Save sivagao/5050320 to your computer and use it in GitHub Desktop.
Using sencha touch 1.x to create a springboard. vertical padding using {xtype: 'panel','height':'20'}; horizon padding using {xtype: spacer}
app.views.Home = Ext.extend(Ext.Panel, {
title: 'Home',
iconCls: 'home',
dockedItems: [
{
dock: 'top',
xtype: 'toolbar',
title: '<img class="logo" src="app/images/logo.png" />',
}
],
items: [
{
xtype: 'panel',
height: 20
},
/* Video & Google Maps Buttons */
new Ext.Panel({
height: 100,
layout: {
type: 'hbox',
pack: 'center',
},
items: [
{
xtype: 'spacer'
},
{
xtype: 'button',
cls: 'mapIcon',
width: 100,
height: 100,
handler: function() {
app.views.viewport.setActiveItem(app.views.map, {type: 'slide', direction: 'left'});
}
},
{
xtype: 'spacer'
},
{
xtype: 'button',
cls: 'twitterIcon',
width: 100,
height: 100,
handler: function() {
app.views.viewport.setActiveItem(app.views.twitter, {type: 'slide', direction: 'left'});
}
},
{
xtype: 'spacer'
}
]
}),
{
xtype: 'panel',
height: 20
},
/* Camera and Twitter Buttons */
new Ext.Panel({
height: 100,
layout: {
type: 'hbox',
pack: 'center',
},
items: [
{
xtype: 'spacer'
},
{
xtype: 'button',
cls: 'paymentIcon',
width: 100,
height: 100,
handler: function() {
app.views.viewport.setActiveItem(app.views.payment, {type: 'slide', direction: 'left'});
}
},
{
xtype: 'spacer'
},
{
xtype: 'button',
cls: 'cameraIcon',
width: 100,
height: 100,
handler: function() {
Ext.dispatch({
controller: app.controllers.camera,
action: 'openCamera'
});
}
},
{
xtype: 'spacer'
}
]
}),
{
xtype: 'panel',
height: 20
},
/* Webview & Settings Buttons */
new Ext.Panel({
height: 100,
layout: {
type: 'hbox',
pack: 'center',
},
items: [
{
xtype: 'spacer'
},
{
xtype: 'button',
cls: 'webviewIcon',
width: 100,
height: 100,
handler: function() {
$fh.webview({
title: 'FeedHenry',
url: 'http://www.feedhenry.com/'
});
}
},
{
xtype: 'spacer'
},
{
xtype: 'button',
cls: 'settingsIcon',
width: 100,
height: 100,
handler: function() {
app.views.viewport.setActiveItem(app.views.settings, {type: 'slide', direction: 'left'});
}
},
{
xtype: 'spacer'
}
]
}),
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment