[TIMOB-28290] Android: Scroll events do not fire for ListView and TableView
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2021-01-27T15:29:18.000+0000 |
| Affected Version/s | Release 9.3.0 |
| Fix Version/s | Release 9.3.1 |
| Components | Android |
| Labels | android, regression, tableview |
| Reporter | Andreas Pingas |
| Assignee | Gary Mathews |
| Created | 2020-12-15T09:26:31.000+0000 |
| Updated | 2021-01-27T15:35:06.000+0000 |
Description
Hello,
Listener scroll in tableview is not responding in the latest SDK 9.3.0
Could you please check.
Thank you in advance.
var win = Ti.UI.createWindow();
var tableData = [];
for (let i =0; i <100; i++) {
tableData.push({ title: i = ${i} });
}
var table = Ti.UI.createTableView({
data: tableData
});
win.add(table);
table.addEventListener('scroll', () => {
console.log('scrolling');
});
win.open();
Attachments
| File | Date | Size |
|---|---|---|
| ListViewCanScrollTest.js | 2020-12-17T23:02:47.000+0000 | 1206 |
Below comment was made pre-coffee, I was testing against 9.2.2.GA... I can confirm this issue is a regression in 9.3.0.GA -[~andreas.pingas] I'm unable to reproduce your issue based on the following code, the
scrolllistener is firing when I scroll the TableView. Could you please provide a minimal sample to reproduce this issue-master: https://github.com/appcelerator/titanium_mobile/pull/12348
FR Passed, waiting on Jenkins build.
merged to master, backport for 9_3_X merged for 9.3.1 target.
Note that with the fix above I get the following crash when scrolling a listview with zero items in the first section: java.lang.ClassCastException: ti.modules.titanium.ui.widget.listview.ListViewProxy cannot be cast to ti.modules.titanium.ui.widget.listview.ListSectionProxy at ti.modules.titanium.ui.widget.listview.TiListView.generateScrollPayload(TiListView.java:263)
Able to reproduce the issue mentioned above using the following test case
*+Error:+*const window = Ti.UI.createWindow(); const emptySection = Ti.UI.createListSection({ headerTitle: "I'm an empty Section" }); const listItems = []; for (let index = 0; index < 100; index++) { listItems[index] = { properties: { title: "Row " + (index + 1).toString() } }; } const listSection = Ti.UI.createListSection({ headerTitle: "List Section" }); listSection.items = listItems; const listView = Ti.UI.createListView({ canScroll: true, }); listView.sections = [emptySection, listSection]; window.add(listView); window.open();