[TIMOB-28352] Android: Application crashes when scrolling to listview marker
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-05-18T18:22:22.000+0000 |
Affected Version/s | Release 9.3.0 |
Fix Version/s | Release 10.0.0, Release 9.3.3 |
Components | Android |
Labels | ListView, android, marker, regression |
Reporter | Ahmed Mohamed |
Assignee | Gary Mathews |
Created | 2021-02-06T18:09:12.000+0000 |
Updated | 2021-06-01T22:33:27.000+0000 |
Description
The application will crash when trying to fire a marker event in listview.
Tested with SDK 9.3.1.GA and 9.3.2.v20210205063432.
*+Test Steps:+*
Create a New titanium application
Copy the test case below into the application
Run the application
Scroll list view to Row 20
*+Test Case:+*
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];
listView.addMarker({
sectionIndex: 1,
itemIndex: 20
});
listView.addEventListener("marker", () => {
alert("Here");
});
window.add(listView);
window.open();
The error:
A try & catch in ListViewProxy around layoutManager.isViewPartiallyVisible + if (isVisible) works but doesn't look like the correct solution :)
master: https://github.com/appcelerator/titanium_mobile/pull/12472
Please also apply as patch for 9_3_X
FR Passed. Waiting for Jenkins build.
merged to master for 10.0.0 target. Also backport PR merged to 9_3_X maintenance branch (but we do not expect to release a formal 9.3.3 GA, so users wanting fix can install via
ti sdk install -b 9_3_X
)Sometimes marker event doesn't fire. please check it again
In SDK 10.0.0.GA the marker never fired if we don't set item height
[~saidCh] See https://github.com/appcelerator/titanium_mobile/pull/12857