[TIMOB-15682] Android: ListView not updating items properly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-11-07T18:42:31.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | 2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0 |
Components | Android |
Labels | api, module_listview, qe-manualtest, qe-testadded, regression |
Reporter | Hieu Pham |
Assignee | Hieu Pham |
Created | 2013-11-07T00:38:10.000+0000 |
Updated | 2014-10-16T00:59:22.000+0000 |
Description
ListView doesn't update items correctly when multiple templates are used. This is a regression (Works in 3.1.3.GA, fails with latest master).
Testing code:
var win = Ti.UI.createWindow();
var viewTemplate = {
childTemplates: [
{
type: 'Ti.UI.View',
bindId: 'View',
properties: {
height: '50dp',
backgroundColor: 'red'
}
}
]
};
var items = [
{ template: 'View'}
];
for ( var i = 0; i < 20; i++) {
items.push({ properties: { title: 'Item', height: '50dp'}});
}
var section = Ti.UI.createListSection({
items: items
});
var listView = Ti.UI.createListView({
backgroundColor: 'black',
templates: {
'View': viewTemplate
},
sections: [ section ]
});
win.add(listView);
win.open();
1. Run code. There should be only one red view in the list view - The first item.
2. Scroll back and forth. Notice the red view changed position.
Expected Result: There should only be one red view in the list view, and scrolling shouldn't modify its position.
master PR: https://github.com/appcelerator/titanium_mobile/pull/4924
Verified the fix. The red view does not move on scrolling the listview. Closing. Environment: Appcel Studio : 3.2.0.201311080232 Ti SDK : 3.2.0.v20131108155642 Mac OSX : 10.8.5 Alloy : 1.3.0 CLI - 3.2.0 Device: Samsung Galaxy S4 running android 4.2.2