Skip to content

Commit

Permalink
[#1826 state:fixed-in-qa] In Phone->Contacts->Display People KS test,…
Browse files Browse the repository at this point in the history
… remove android-specific block for tableview click handler now that tableviewrow clicks have been fixed. Show a little label if no addresses were found to be displayed.
  • Loading branch information
billdawson committed Sep 15, 2010
1 parent c02192e commit d713121
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions demos/KitchenSink/Resources/examples/contacts_db.js
Expand Up @@ -30,6 +30,7 @@ var makeTable = function() {
});

var top = 0;
var showedSomething = false;
for (var label in e.row.person.address) {
top += 20;
var addrs = e.row.person.address[label];
Expand All @@ -42,8 +43,12 @@ var makeTable = function() {
width:'auto',
});
display.add(info);
showedSomething = true;
}
}
if (!showedSomething){
display.add(Ti.UI.createLabel({text: 'No addresses to show'}));
}

Titanium.UI.currentTab.open(display,{animated:true});
});
Expand All @@ -55,32 +60,5 @@ var tableview = Ti.UI.createTableView({
data:makeTable()
});

if (android) {
tableview.addEventListener('click', function(e) {
var display = Ti.UI.createWindow({
backroundColor:'white',
title:e.row.person.fullName
});

var top = 0;
for (var label in e.row.person.address) {
top += 20;
var addrs = e.row.person.address[label];
for (var i = 0; i < addrs.length; i++) {
var info = Ti.UI.createLabel({
text:'('+label+') '+addrs[i].Street,
top:top,
left:20,
height:'auto',
width:'auto',
});
display.add(info);
}
}

Titanium.UI.currentTab.open(display,{animated:true});
});
}

win.add(tableview);
if (android && activityIndicator) {activityIndicator.hide();}
if (android && activityIndicator) {activityIndicator.hide();}

0 comments on commit d713121

Please sign in to comment.