[AC-6704] Android Listview marker event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-06-03T10:31:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | ListView, android, infinitescroll, marker |
Reporter | said chaouche |
Assignee | Abir Mukherjee |
Created | 2021-05-28T14:52:27.000+0000 |
Updated | 2021-06-03T10:31:09.000+0000 |
Description
Marker event in ListView not work correctly on TiSDK 10.0.0.GA, see code below
Workaround is to set a ListItem Height is fix the problem but sometime the event not fire and need no scroll again to have the event.
This bug have a big impact on app with infinite scroll
var sections = [];
var listView = Ti.UI.createListView();
listView.addEventListener("marker", (e) => {
Ti.API.info("MARKER EVENT FIRED");
addSection();
});
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
win.addEventListener("open", addSection)
win.add(listView);
win.open();
function addSection() {
var dataSet = [];
for (var i = 0; i < 20; i++) {
dataSet.push({
properties: {
title: "ITEM AT " + (i + 1),
// set height size to fix marker event bug
// height: 50,
}
});
}
var section = Ti.UI.createListSection({
items: dataSet
});
sections.push(section);
listView.sections = sections;
var marker = {
sectionIndex: sections.length - 1,
itemIndex: dataSet.length - 1
}
Ti.API.info("MARKER", JSON.stringify(marker));
listView.addMarker(marker);
}
This is fixed by TIMOB-28462 and available in 10.1.0 (ti sdk install -b master) and 10_0_X (ti sdk install -b 10_0_X) CI builds