Permalink
Browse files

new image icons and improved app layout

  • Loading branch information...
1 parent 9718695 commit dea315f5054dfa5c8fa8f6d810b29302cd974407 @n8fr8 n8fr8 committed Mar 31, 2011
View
26 Resources/app.js
@@ -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"
});
@@ -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
@@ -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'
@@ -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);
}
View
16 Resources/globals.js
@@ -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();
});
@@ -176,7 +172,6 @@ function showWebModal(wTitle, wUrl)
createWebView();
-
webModal.title = wTitle;
Titanium.UI.currentTab.open(webModal,{animated:true});
@@ -259,7 +254,7 @@ function showNYSenateContent(wTitle, wUrl)
webModalView.html = processNYSenateHtml(cFile);
- toolActInd.hide();
+ hideLoadingDialog();
}
else
{
@@ -276,7 +271,8 @@ function showNYSenateContent(wTitle, wUrl)
webModalView.html = processNYSenateHtml(this.responseText);
- toolActInd.hide();
+
+ hideLoadingDialog();
};
View
0 Resources/img/header/nyss_header_bg1.jpg → Resources/img/header/headerfull.jpg
File renamed without changes
View
BIN Resources/img/header/openleglogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/icons/calendar32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/icons/comments32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/icons/legislation32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/icons/more32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/icons/senators26.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/icons/senators32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/(01-10-11) Gallivan-HS-007.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/(01-10-11) Zeldin-HS-042.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/(01-11-11) O'Mara-011.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/(03-03-09) Huntley-HS-015_2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/Adriano Espaillat Headshot.JPG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/Kemp head shot 2.JPG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/Official photo.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/Senator Fuschillo's Headshot-2011_0.JPG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/Senator Kennedy headshot.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/ball_HS2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/headshot.JPG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/headshotvm.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/img/senators/mg_web.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 Resources/inc/youtube.js
@@ -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"
View
83 Resources/tabs.js
@@ -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);
@@ -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
});
@@ -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
});
@@ -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");
+
+});
View
2 Resources/views/findsenator.js
@@ -2,6 +2,8 @@ Ti.include("../globals.js");
var win = Titanium.UI.currentWindow;
+win.top = 150;
+
var geoInProgress = false;
var rowHeight = 40;
View
41 Resources/views/legislation.js
@@ -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++)
@@ -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'
@@ -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'
@@ -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
});
View
8 Resources/views/newsroom.js
@@ -32,6 +32,8 @@ function parseNewsroomResponse (responseText)
hideLoadingDialog();
newsItems = [];
+
+ //Ti.API.info(responseText);
var data = JSON.parse('{"data":' + responseText + '}').data;
@@ -67,7 +69,7 @@ function parseNewsroomResponse (responseText)
{
for (dIdx = 0; dIdx < descImages.length; dIdx++)
{
- Ti.API.debug("found match: " + descImages[dIdx]);
+ //Ti.API.debug("found match: " + descImages[dIdx]);
newsItems[i].thumbnail = descImages[dIdx];
}
@@ -112,13 +114,13 @@ function addRow (newsItem)
text:newsItem.title,
left:60,
top:1,
- height:rowHeight,
+ height:rowHeight * .6,
font:{fontSize:18},
color:'#333333'
});
row.add(labelTitle);
-
+
if (newsItem.thumbnail)
{
var cachedImage = getCachedFile(newsItem.thumbnail);
View
21 Resources/views/olsearch.js
@@ -5,12 +5,7 @@ var OL_ITEM_BASE = 'http://open.nysenate.gov/api/1.0/mobile/';
var win = Titanium.UI.currentWindow;
-var toolActInd = Titanium.UI.createActivityIndicator();
-//toolActInd.style = Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN;
-toolActInd.font = {fontFamily:'Helvetica Neue', fontSize:15,fontWeight:'bold'};
-toolActInd.color = 'white';
-toolActInd.message = 'Searching legislative data...';
-toolActInd.show();
+
// create table view data object
var data =[];
@@ -30,6 +25,9 @@ if (Titanium.UI.currentWindow.olterm)
listUrl += "&term=" + escape(olterm);
}
+showLoadingDialog("Searching","Connecting to Open Legislation...");
+
+
/*
var pageIdx = "1";
var pageSize = "50";
@@ -56,7 +54,7 @@ xhr.onerror = function (e)
{
Titanium.API.debug("got xhr error: " + e);
- toolActInd.hide();
+ hideLoadingDialog();
//alert(e);
Titanium.UI.createAlertDialog({title:'NY Senate', message:'There was an error accessing the legislative data. Please try again later.'}).show();
@@ -190,9 +188,9 @@ xhr.onload = function()
tableview = Titanium.UI.createTableView({
data:data,
- backgroundColor:"#ffffff",
- opacity:.8,
- color:"#333333"
+ color:"#333333",
+ separatorColor:"#cccccc",
+ backgroundImage:'../img/bg/bglight.jpg',
});
Titanium.UI.currentWindow.add(tableview);
@@ -218,7 +216,8 @@ xhr.onload = function()
}
- toolActInd.hide();
+
+ hideLoadingDialog();
};
View
43 Resources/views/senator.js
@@ -1,11 +1,14 @@
Ti.include("../globals.js");
+var SENATOR_IMAGE_BASE = "http://www.nysenate.gov/files/imagecache/teaser_featured_image/profile-pictures/";
+
var win = Titanium.UI.currentWindow;
var IMAGE_RESIZER = "http://nysenatemobile.appspot.com/servlet/ImageResizer?url=";
+win.backgroundImage = "../img/bg/wood.jpg";
var senatorName = win.senatorName;
-var senatorImage = win.senatorImage;
+var senatorImage = SENATOR_IMAGE_BASE + escape(win.senatorImage);
var senatorKey = win.senatorKey;
var senatorDistrict = win.senatorDistrict;
var senatorNodeId = win.nid;
@@ -31,6 +34,8 @@ legSearchKey = legSearchKey.replace("-jr","");
legSearchKey = legSearchKey.replace("-sr","");
legSearchKey = legSearchKey.substring(legSearchKey.lastIndexOf("-")+1);
+Ti.API.info("got senator image: " + senatorImage);
+
/*
var cachedImage = getCachedFile(senatorImage);
@@ -45,7 +50,7 @@ var imgSenator = Titanium.UI.createImageView({
url:senatorImage,
width:85,
height:112,
- top:10,
+ top:30,
left:10,
visible:true,
backgroundColor:"#ffffff",
@@ -70,7 +75,7 @@ var messageLabel = Titanium.UI.createLabel({
text:senatorTitleText,
left:105,
width:205,
- top:20,
+ top:40,
height:'auto',
font:{fontSize:20}
@@ -85,32 +90,32 @@ if (isiOS4Plus())
{
tdata = [
{title:'Contact Information',hasChild:true,link:senatorUrl + "/contact"},
- {title:'View District Map',hasChild:true,title:'District Map',kml:'http://geo.nysenate.gov/maps/kml/sd' + senatorDistrict + '.kml?key=YgiZWjKgealrvSlyDMQRMYEaNLv2fFiz'},
- {title:"Latest News & Updates",hasChild:true, rss:senatorUrl+ "/content/feed"},
+ {title:'District Map',hasChild:true,title:'District Map',kml:'http://geo.nysenate.gov/maps/kml/sd' + senatorDistrict + '.kml?key=YgiZWjKgealrvSlyDMQRMYEaNLv2fFiz'},
+ {title:"Newsroom",hasChild:true, rss:senatorUrl+ "/content/feed"},
{title:'Sponsored Bills',hasChild:true,olterm:"sponsor:"+legSearchKey + " AND otype:bill AND (oid:S* or oid:A*)"},
- {title:'Chaired Meetings',hasChild:true,olterm:"chair:"+legSearchKey + " AND otype:meeting"},
- {title:'All Legislative Activity',hasChild:true,olterm:legSearchKey},
+// {title:'Chaired Meetings',hasChild:true,olterm:"chair:"+legSearchKey + " AND otype:meeting"},
+// {title:'All Legislative Activity',hasChild:true,olterm:legSearchKey},
{title:'Biography',hasChild:true,link:senatorUrl + "/bio"}
];
}
else
{
tdata = [
- {title:'Contact Information',hasChild:true,link:senatorUrl + "/contact"},
- {title:'View District Map',hasChild:true,title:'District Map',elink:'http://www.nysenate.gov/files/imagecache/district_map/' + senatorDistrict + '_small_0.png'},
- {title:"Latest News & Updates",hasChild:true, rss:senatorUrl+ "/content/feed"},
- {title:'Sponsored Bills',hasChild:true,olterm:"sponsor:"+legSearchKey + " AND otype:bill AND (oid:S* or oid:A*)"},
- {title:'Chaired Meetings',hasChild:true,olterm:"chair:"+legSearchKey + " AND otype:meeting"},
- {title:'All Legislative Activity',hasChild:true,olterm:legSearchKey},
- {title:'Biography',hasChild:true,link:senatorUrl + "/bio"}
+ {title:'Contact Information',hasChild:true,link:senatorUrl + "/contact",color:"#333333"},
+ {title:'District Map',hasChild:true,title:'District Map',elink:'http://www.nysenate.gov/files/imagecache/district_map/' + senatorDistrict + '_small_0.png',color:"#333333"},
+ {title:"Newsroom",hasChild:true, rss:senatorUrl+ "/content/feed",color:"#333333"},
+ {title:'Sponsored Bills',hasChild:true,olterm:"sponsor:"+legSearchKey + " AND otype:bill AND (oid:S* or oid:A*)",color:"#333333"},
+// {title:'Chaired Meetings',hasChild:true,olterm:"chair:"+legSearchKey + " AND otype:meeting"},//
+// {title:'All Legislative Activity',hasChild:true,olterm:legSearchKey},
+ {title:'Biography',hasChild:true,link:senatorUrl + "/bio",color:"#333333"}
];
}
if (twitter && twitter != "null")
{
var row = new Object();
-row.title = "Twitter Feed";
+row.title = "Twitter";
row.hasChild = true;
row.link = twitter;
tdata[tdata.length] = row;
@@ -124,7 +129,7 @@ if (facebook && facebook != "null")
{
var row = new Object();
-row.title = "Facebook Page";
+row.title = "Facebook";
row.hasChild = true;
row.link = facebook;
tdata[tdata.length] = row;
@@ -138,9 +143,11 @@ tdata[tdata.length] = row;
// create table view
var tableViewOptions = {
data:tdata,
- top:130,
+ top:150,
left:0,
- visible:true
+ visible:true,
+ separatorColor:"#cccccc",
+ backgroundColor:"#ffffff"
};
View
10 Resources/views/senators.js
@@ -16,8 +16,9 @@ xhr.setTimeout(30000);
senatorView = Titanium.UI.createTableView({
- backgroundColor:"#ffffff",
- left:0
+ left:0,
+ separatorColor:"#cccccc",
+ backgroundImage:'../img/bg/bglight.jpg'
});
@@ -35,7 +36,8 @@ senatorView = Titanium.UI.createTableView({
senatorName:senatorItems[e.index].senator.name,
senatorImage:senatorItems[e.index].senator.imageUrlLarge,
senatorKey:senatorItems[e.index].senator.name,
- senatorDistrict:senatorItems[e.index].senator.district
+ senatorDistrict:senatorItems[e.index].senator.district,
+ modal:true
});
@@ -191,7 +193,7 @@ function parseSenatorResponse (responseText)
//}
- senatorItems[i].senator.imageUrlLarge = imageUrl;
+ senatorItems[i].senator.imageUrlLarge = senatorItems[i].senator.imageFileName;
senatorItems[i].senator.district = senatorItems[i].senator.district.split(' ')[3];
View
25 Resources/views/today.js
@@ -484,7 +484,7 @@ var flexSpace = Titanium.UI.createButton({
btnNext.addEventListener('click',function()
{
- Titanium.API.debug("next day");
+
monthOffset++;
loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
@@ -499,7 +499,7 @@ var flexSpace = Titanium.UI.createButton({
btnPrev.addEventListener('click',function()
{
- Titanium.API.debug("prev day");
+
monthOffset--;
loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
});
@@ -508,18 +508,31 @@ var flexSpace = Titanium.UI.createButton({
}
else
{
- var tb1 = null;
-
+ var menu1 = null;
+ var menu2 = null;
+ var menu2 = null;
+
var menuHandler = function() {
- tb1.addEventListener('click', function() {
+ menu1.addEventListener('click', function() {
+ monthOffset--;
+ loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
+ });
+ menu2.addEventListener('click', function() {
+ loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
+ });
+ menu3.addEventListener('click', function() {
+ monthOffset++;
loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
});
};
var activity = Ti.Android.currentActivity;
activity.onCreateOptionsMenu = function(e) {
var menu = e.menu;
- tb1 = menu.add({title : 'Reload'});
+ menu1 = menu.add({title : 'Prev'});
+ menu2 = menu.add({title : 'Reload'});
+ menu3 = menu.add({title : 'Next'});
+
menuHandler();
};
}

0 comments on commit dea315f

Please sign in to comment.