Skip to content

Commit

Permalink
new image icons and improved app layout
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Mar 31, 2011
1 parent 9718695 commit dea315f
Show file tree
Hide file tree
Showing 32 changed files with 156 additions and 121 deletions.
26 changes: 12 additions & 14 deletions Resources/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,45 @@ var win;
win = Titanium.UI.createWindow({
title:'New York State Senate',
barColor:DEFAULT_BAR_COLOR,
backgroundImage:'img/bg/bglight.jpg',
orientationModes:[Titanium.UI.PORTRAIT],
navBarHidden:true
});

var imgHeader = Ti.UI.createImageView({
image:"img/header/header1.jpg",
image:'img/header/headerfull.jpg',
top:0,
left:0,
height:70
});

win.add(imgHeader);

var imgTitle = Ti.UI.createImageView({
image:"img/header/nyss_logo.png",
top:0,
left:0,
image:'img/header/nyss_logo.png',
top:4,
left:4,
height:56,
width:259
});
win.add(imgTitle);




// create table view data object
var data = [
{title:'Senators', summary:'', hasDetail:true, ilink:'tabs.js',tabIdx:0, icon:'img/icons/senators.png'},
{title:'Session Calendar', summary:'', hasDetail:true,ilink:'tabs.js',tabIdx:1, icon:'img/icons/calendar.png'},
{title:'Newsroom', summary:'', hasDetail:true,ilink:'tabs.js',tabIdx:2, icon:'img/icons/comments.png'},
{title:'Open Legislation', summary:'', hasDetail:true, ilink:'tabs.js',tabIdx:3, icon:'img/icons/legislation.png'},
{title:'Latest Videos', summary:'', hasDetail:true, ilink:'views/videos.js', icon:'img/icons/videos.png'},
{title:'Latest Videos', summary:'', hasDetail:true, ilink:'inc/youtube.js', icon:'img/icons/videos.png'},
{title:'Find Your Senator', summary:'', hasDetail:true, ilink:'views/findsenator.js', icon:'img/icons/search.png'},
{title:'More Information', summary:'', hasDetail:true, ilink:'tabs.js',tabIdx:4, icon:'img/icons/more.png'},
{title:'Visit NYSenate.gov', summary:'', hasDetail:true, elink:'http://nysenate.gov', icon:'img/icons/home.png'},
];

var tableview = Titanium.UI.createTableView(
{
backgroundColor:"#ffffff",
opacity:.8,
top:64,
backgroundImage:'img/bg/bglight.jpg',
top:70,
separatorColor:"#cccccc"

});
Expand All @@ -71,7 +69,7 @@ for (var c = 0; c < data.length; c++)

var labelImg = Ti.UI.createImageView({
image:data[c].icon,
top:8,
top:6,
left:2,
height:48,
width:48
Expand All @@ -81,7 +79,7 @@ for (var c = 0; c < data.length; c++)
var labelTitle = Ti.UI.createLabel({
text:data[c].title,
left:56,
top:15,
top:12,
height:35,
font:{fontSize:20},
color:'#333333'
Expand Down Expand Up @@ -154,7 +152,7 @@ tableview.addEventListener('click', function(e)


}
if (e.rowData.elink)
else if (e.rowData.elink)
{
showWebModal(e.rowData.pageTitle,e.rowData.elink);
}
Expand Down
16 changes: 6 additions & 10 deletions Resources/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,20 @@ function createWebView ()
webModal.rightNavButton = btnSearch;
}

toolActInd = Titanium.UI.createActivityIndicator();
toolActInd.font = {fontFamily:'Helvetica Neue', fontSize:15,fontWeight:'bold'};
toolActInd.color = 'white';
toolActInd.message = 'Loading...';


webModalView.addEventListener('beforeload',function(e)
{
Ti.API.debug("webview beforeload: "+e.url);

toolActInd.show();
showLoadingDialog("Loading","Loading web content...");

});

webModalView.addEventListener('load',function(e)
{
Ti.API.debug("webview loaded: "+e.url);

toolActInd.hide();
hideLoadingDialog();

});

Expand All @@ -176,7 +172,6 @@ function showWebModal(wTitle, wUrl)

createWebView();


webModal.title = wTitle;

Titanium.UI.currentTab.open(webModal,{animated:true});
Expand Down Expand Up @@ -259,7 +254,7 @@ function showNYSenateContent(wTitle, wUrl)

webModalView.html = processNYSenateHtml(cFile);

toolActInd.hide();
hideLoadingDialog();
}
else
{
Expand All @@ -276,7 +271,8 @@ function showNYSenateContent(wTitle, wUrl)

webModalView.html = processNYSenateHtml(this.responseText);

toolActInd.hide();

hideLoadingDialog();

};

Expand Down
File renamed without changes
Binary file added Resources/img/header/openleglogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/icons/calendar32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/icons/comments32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/icons/legislation32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/icons/more32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/icons/senators26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/icons/senators32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/(01-11-11) O'Mara-011.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/Kemp head shot 2.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/Official photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/ball_HS2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/headshot.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/headshotvm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/img/senators/mg_web.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Resources/inc/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ xhr.onload = function()
var labelTitle = Ti.UI.createLabel({
text:title,
left:105,
top:10,
top:5,
height:40,
font:{fontSize:16},
color:"#ffffff"
Expand Down
83 changes: 37 additions & 46 deletions Resources/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ if (Ti.UI.currentWindow.tabIdx)
// create tab group
var tabGroup = Titanium.UI.createTabGroup({});

//
// create base UI tab and root window
//
var winHome;
//third tab
var winSenators;

winHome = Titanium.UI.createWindow({
title:'New York State Senate',
url:'views/newsroom.js',
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]
});
winSenators = Titanium.UI.createWindow({
title:'Senators',
url:'views/senators.js',
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]
});

var tabHome = Titanium.UI.createTab({
icon:'img/tabs/bank.png',
title:'Newsroom',
window:winHome

var tabSenators = Titanium.UI.createTab({
icon:'img/icons/senators32.png',
title:'Senators',
window:winSenators
});

tabGroup.addTab(tabHome);

tabGroup.addTab(tabSenators);



Expand All @@ -35,52 +35,45 @@ tabGroup.addTab(tabHome);
var winToday = Titanium.UI.createWindow({
title:'Calendar',
url:'views/today.js',
barColor:DEFAULT_BAR_COLOR,
backgroundImage:"img/bg/Default.png",
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]

});
var tabToday = Titanium.UI.createTab({
icon:'img/tabs/newspaper.png',
icon:'img/icons/calendar32.png',
title:'Calendar',
window:winToday
});

tabGroup.addTab(tabToday);

//
// create base UI tab and root window
//
var winHome;

//third tab
var winSenators;


winSenators = Titanium.UI.createWindow({
title:'Senators',
url:'views/senators.js',
barColor:DEFAULT_BAR_COLOR,
backgroundImage:'img/bg/Default.png',
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]
});

winHome = Titanium.UI.createWindow({
title:'New York State Senate',
url:'views/newsroom.js',
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]
});

var tabSenators = Titanium.UI.createTab({
icon:'img/tabs/man.png',
title:'Senators',
window:winSenators
var tabHome = Titanium.UI.createTab({
icon:'img/icons/comments32.png',
title:'Newsroom',
window:winHome
});


tabGroup.addTab(tabSenators);
tabGroup.addTab(tabHome);

//fourth tab
var winOpenLeg = Titanium.UI.createWindow({
title:'Legislation',
url:'views/legislation.js',
barColor:DEFAULT_BAR_COLOR,
backgroundImage:"img/bg/Default.png",
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT],
backgroundColor:"#ffffff"
});
var tabOpenLeg = Titanium.UI.createTab({
icon:'img/tabs/database.png',
icon:'img/icons/legislation32.png',
title:'Legislation',
window:winOpenLeg
});
Expand All @@ -91,12 +84,10 @@ tabGroup.addTab(tabOpenLeg);
var winMore = Titanium.UI.createWindow({
title:'More',
url:'views/more.js',
barColor:DEFAULT_BAR_COLOR,
backgroundImage:"img/bg/Default.png",
orientationModes:[Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT,Titanium.UI.PORTRAIT]
});
var tabMore = Titanium.UI.createTab({
icon:'img/tabs/preferences.png',
icon:'img/icons/more32.png',
title:'More',
window:winMore
});
Expand All @@ -111,8 +102,8 @@ tabGroup.open({
tabGroup.setActiveTab(tabIdx);

tabGroup.addEventListener('close', function(e)
{
Titanium.API.info("TAB GROUP - got close");
});
{
// Titanium.API.info("TAB GROUP - got close");

});

2 changes: 2 additions & 0 deletions Resources/views/findsenator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Ti.include("../globals.js");

var win = Titanium.UI.currentWindow;

win.top = 150;

var geoInProgress = false;
var rowHeight = 40;

Expand Down
41 changes: 33 additions & 8 deletions Resources/views/legislation.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
// create table view data object
Ti.include("../globals.js");



var imgHeader = Ti.UI.createImageView({
image:'../img/header/openleglogo.png',
top:2,
left:2,
height:36
});

Titanium.UI.currentWindow.add(imgHeader);

var data = [];

data.push({title:'Bills & Resolutions',summary:'Senate Bills, Resolution and more', link:'olsearch.js', oltype:'bill'});
data.push({title:'Online Search',summary:'keyword searching for all of Open Legislation', dosearch:'true'});
data.push({title:'Bills & Resolutions',summary:'Legislative Data for the current session', link:'olsearch.js', oltype:'bill'});
data.push({title:'Meeting Agendas',summary:'Committee Meetings Time, Place, Notes and Bills', link:'olsearch.js', oltype:'meeting'});
data.push({title:'Calendars & Active Lists', summary:'Bills scheduled for the Senate Floor',link:'olsearch.js', oltype:'calendar'});
data.push({title:'Bill Actions',summary:'Every Action for Every Bill', link:'olsearch.js', oltype:'action'});
//data.push({title:'Bill Actions',summary:'Every Action for Every Bill', link:'olsearch.js', oltype:'action'});
data.push({title:'Recent Votes', summary:'Floor and Committee Vote Records',link:'olsearch.js', oltype:'vote'});
data.push({title:'Transcripts', summary:'Senate Session and Hearing Transcripts', link:'olsearch.js', oltype:'transcript'});
data.push({title:'By Committee', summary:'Browse Legislation by Committee', link:'committees.js'});



// create table view
var tableview = Titanium.UI.createTableView({
backgroundColor:"#ffffff"
backgroundColor:"#ffffff",
top:45,
left:0,
separatorColor:"#cccccc",
backgroundImage:'../img/bg/bglight.jpg'

});

for (var c = 0; c < data.length; c++)
Expand All @@ -31,8 +50,8 @@ for (var c = 0; c < data.length; c++)

var labelTitle = Ti.UI.createLabel({
text:data[c].title,
left:10,
top:5,
left:6,
top:6,
height:35,
font:{fontSize:20},
color:'#333333'
Expand All @@ -41,7 +60,7 @@ for (var c = 0; c < data.length; c++)

var labelTime = Ti.UI.createLabel({
text:data[c].summary,
left:10,
left:6,
top:40,
font:{fontSize:14},
color:'#555555'
Expand Down Expand Up @@ -74,17 +93,23 @@ tableview.addEventListener('click', function(e)

Titanium.UI.currentTab.open(win,{animated:true});
}
else if (e.rowData.dosearch)
{
search.visible = true;
tableview.top = 45;
}
});


// add table view to the window
Titanium.UI.currentWindow.add(tableview);

var search = Titanium.UI.createSearchBar({
barColor:'#000',
barColor:'#333333',
hintText:'enter search keywords',
showCancel:true,
height:43,
top:0,
top:2,
visible:false
});

Expand Down
Loading

0 comments on commit dea315f

Please sign in to comment.