[AC-6722] ListView: continuous update for scrolling event
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Michael Gangolf |
Assignee | Joshua Quick |
Created | 2021-10-04T12:30:47.000+0000 |
Updated | 2021-10-04T19:24:47.000+0000 |
Description
The current
scrolling
event will only fire when there is a change in the direction.
*Adding continuousUpdate
:*
When continuousUpdate
is enabled the scrolling event will fire for every visibleItem/Section change.
Would love to see an iOS parity ticket!
var toggle = true;
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: "change",
bottom: 20
});
btn.addEventListener("click", function() {
toggle = !toggle;
listView.continuousUpdate = toggle
console.log(listView.continuousUpdate);
})
win.add(btn);
var listView = Ti.UI.createListView({
height: Ti.UI.FILL,
width: Ti.UI.FILL,
continuousUpdate: true
});
var sections = [];
for (var s = 0; s < 5; s++) {
var section = Ti.UI.createListSection({
headerTitle: 'Section ' + s
});
var set = [];
for (var i = 0; i < 20; ++i) {
set.push({
properties: {
title: 'Item 0 ' + i
}
})
}
section.setItems(set);
sections.push(section);
}
listView.sections = sections;
win.add(listView);
listView.addEventListener("scrolling", function(e) {
console.log("Item", e.firstVisibleItemIndex, e.firstVisibleSectionIndex);
})
win.open();
No comments