[TIMOB-13061] Android: ImageView: Images are not rendered correctly if the url is not valid
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-14T19:01:38.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06 |
Components | Android |
Labels | api, qe-testadded, triage |
Reporter | Ping Wang |
Assignee | Ping Wang |
Created | 2013-03-14T06:55:54.000+0000 |
Updated | 2013-09-26T07:03:24.000+0000 |
Description
Steps to reproduce:
1. Run the test code. Row 2, Row 4 and Row 8 have no images.
2. Scroll up and down the list view.
Expect result: Row 2, Row 4 and Row 8 should always have no images.
Actual result: Row 2, Row 4 and Row 8 have random images showing.
var win = Ti.UI.createWindow({
backgroundColor : 'white'
})
var listContainer = Ti.UI.createView({
height : '90%'
})
win.add(listContainer);
win.open();
//Basic List View, default template
//Checking to see how height is being set
var listView = Ti.UI.createListView({
defaultItemTemplate : Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT
})
//Both header and footer
var listSection1 = Ti.UI.createListSection({
headerTitle : 'HEADER1',
footerTitle : 'FOOTER1'
})
listSection1.setItems(getDataDefaultTemplate());
//Only header
var listSection2 = Ti.UI.createListSection({
headerTitle : 'HEADER2',
})
//Only footer
var listSection3 = Ti.UI.createListSection({
footerTitle : 'FOOTER3'
})
//Neither
var listSection4 = Ti.UI.createListSection({
})
if (Ti.Platform.osname == 'android') {
listSection2.setItems(getDataDefaultTemplate());
listSection3.setItems(getDataDefaultTemplate());
listSection4.setItems(getDataDefaultTemplate());
}
listView.setSections([listSection1, listSection2, listSection3, listSection4]);
listContainer.add(listView);
function getDataDefaultTemplate() {
var data = [];
var titleStr = '';
for ( i = 0; i < 10; i++) {
titleStr += 'title ';
var mod = i % 4;
var cellh = 50;
var acType = Ti.UI.LIST_ACCESSORY_TYPE_NONE;
var ci = 'KS_nav_ui.png';
if (mod == 1) {
acType = Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK;
cellh = 70;
ci = 'KS_nav_views.png';
} else if (mod == 2) {
acType = Ti.UI.LIST_ACCESSORY_TYPE_DETAIL;
ci = 'junk';
cellh = 90;
} else if (mod == 3) {
acType = Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE;
cellh = 110;
ci = 'http://www.catravelservices.com/management/hotels/pictures/Mawamba_lodge_nature.jpg';
}
var item = {
template : Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT,
properties : {
title : titleStr + i,
image : ci,
accessoryType : acType,
itemId : 'Item ' + i + ' ' + acType,
height : cellh
}
}
data.push(item)
}
return data;
}
PR: https://github.com/appcelerator/titanium_mobile/pull/3965
Verified with the latest build.No images are shown in row 2,4 and 8 now even after scrolling. Environment used for verification - Titanium SDK: 3.1.0.v20130314163255 Titanium Studio:3.0.2.201302151605 Device: Samsung GALAXY Note (2.3.6)