{ "id": "176023", "key": "TIMOB-28337", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21191", "name": "Release 9.3.2", "archived": false, "released": true, "releaseDate": "2021-02-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-02-10T16:35:29.000+0000", "created": "2021-02-05T20:42:00.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "listview", "longpress", "regression" ], "versions": [ { "id": "21177", "name": "Release 9.3.1", "archived": false, "released": true, "releaseDate": "2021-01-26" }, { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-02-12T08:48:30.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "When using the \"longpress\" event on the Android ListView in 9.3.0+, the itemIndex / sectionIndex are not supplied via the event when the longpress occured on a child view of the list item template. I don't have an isolated test case so far, but it should be reproducible on any custom-templates test case that adds the \"longpress\" event to the view wrapper.\r\n\r\nThe same used to work on both iOS and Android. What I can share immediately is the Alloy sample:\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nImportant to note is that the longpress event is added to the item template, not the list view itself as this used to be the only way to handle this. If there are better ways, let me know!\r\n\r\n*EDIT*: Just checked it: The longpress event does not work on the ListView at all (like the itemclick and others), so the above is the only feasible workaround thats now also broken :(", "attachment": [], "flagged": false, "summary": "Android: ListView properties missing in \"longpress\" event in Alloy as of 9.3.0", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "458183", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for looking into this Gary :) Many thanks for this amazing work!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-02-08T16:56:43.000+0000", "updated": "2021-02-08T16:56:43.000+0000" }, { "id": "458190", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] I'm having trouble reproducing this in JS, adding an event listener to a child label will inherit {{sectionIndex}} and {{itemIndex}} etc.. correctly.\r\n\r\n{code:js}\r\nconst win = Ti.UI.createWindow({\r\n backgroundColor: 'gray'\r\n});\r\nconst listView = Ti.UI.createListView({\r\n backgroundColor: 'white',\r\n templates: {\r\n template: {\r\n properties: {\r\n borderRadius: 16,\r\n height: 50\r\n },\r\n childTemplates: [{\r\n type: 'Ti.UI.Label',\r\n bindId: 'label',\r\n events: {\r\n \tlongpress (e) {\r\n \t\tconsole.log('longpress: ' + JSON.stringify(Object.keys(e), null, 2));\r\n \t}\r\n },\r\n properties: {\r\n color: 'white'\r\n }\r\n }]\r\n }\r\n },\r\n defaultItemTemplate: 'template'\r\n});\r\nlistView.sections = [\r\n Ti.UI.createListSection({\r\n items: [{\r\n properties: {\r\n backgroundColor: 'red'\r\n },\r\n label: {\r\n text: 'Red'\r\n }\r\n },\r\n {\r\n properties: {\r\n backgroundColor: 'green'\r\n },\r\n label: {\r\n text: 'Green'\r\n }\r\n },\r\n {\r\n properties: {\r\n backgroundColor: 'blue'\r\n },\r\n label: {\r\n text: 'Blue'\r\n }\r\n },\r\n {\r\n properties: {\r\n backgroundColor: 'yellow'\r\n },\r\n label: {\r\n text: 'Yellow'\r\n }\r\n },\r\n {\r\n properties: {\r\n backgroundColor: 'cyan'\r\n },\r\n label: {\r\n text: 'Cyan'\r\n }\r\n },\r\n {\r\n properties: {\r\n backgroundColor: 'pink'\r\n },\r\n label: {\r\n text: 'Pink'\r\n }\r\n },\r\n ]\r\n })\r\n];\r\n\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n\r\nI'll look into what Alloy is doing, as it may not be making use of the {{events}} property in the template.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-09T02:24:06.000+0000", "updated": "2021-02-09T02:27:02.000+0000" }, { "id": "458197", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/12456", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-09T17:31:57.000+0000", "updated": "2021-02-09T17:31:57.000+0000" }, { "id": "458201", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for jenkins.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-09T23:25:51.000+0000", "updated": "2021-02-09T23:25:51.000+0000" }, { "id": "458228", "author": { "name": "rfarfan", "key": "rfarfan", "displayName": "Rodrigo Farfán", "active": true, "timeZone": "Europe/Madrid" }, "body": "This was also reported in TIMOB-28291.", "updateAuthor": { "name": "rfarfan", "key": "rfarfan", "displayName": "Rodrigo Farfán", "active": true, "timeZone": "Europe/Madrid" }, "created": "2021-02-12T08:44:52.000+0000", "updated": "2021-02-12T08:44:52.000+0000" }, { "id": "458229", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks Rodrigo! I believe now it's fully fixed. You can try the latest 9.3.2 version (ti sdk install -b 9_3_X)!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-02-12T08:48:30.000+0000", "updated": "2021-02-12T08:48:30.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }