{ "id": "126755", "key": "TIMOB-16494", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-04-23T20:11:05.000+0000", "created": "2014-02-24T05:24:05.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_listview", "qe-manualtest", "qe-testadded", "supportTeam" ], "versions": [], "issuelinks": [ { "id": "48000", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "148513", "key": "TIDOC-2219", "fields": { "summary": "Update ListView guide for new improvements", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-06-16T16:56: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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "The current setMarker implementation works fine for a use case when you want to lazy-load data in a list or otherwise only care about scrolling in one direction. However, I have a use case in which I want to know if the user scrolls in either direction in a ListView. It appears that I can only set one marker on the list at a time.\r\n\r\nIn the attached project, I populate the list with 100 items, scroll to item 50, and set markers at 30 and 70. I would like the marker event to fire if the user scrolls to either item 30 or item 70. Right now, I have to choose one or the other, which means I can't implement my desired interface with a ListView.\r\n\r\nIf you allow setting multiple markers, perhaps it will be helpful to also add a clearMarkers method on ListView to remove them all at once.\r\n\r\nAlthough I selected iOS as the platform in the ticket, I assume this impacts all platforms.", "attachment": [ { "id": "46141", "filename": "Sample-ControllerStyleView.zip", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2014-02-24T05:30:41.000+0000", "size": 1471, "mimeType": "application/zip" } ], "flagged": false, "summary": "TiAPI: Allow multiple markers in ListView", "creator": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Alloy 1.3.1\r\nTitanium SDK Mobile 3.2.1.GA\r\nPlatform OS: iOS\r\nPlatform OS Version: 7", "closedSprints": [ { "id": 371, "state": "closed", "name": "2015 Sprint 08 SDK", "startDate": "2015-04-11T00:00:49.626Z", "endDate": "2015-04-24T12:00:00.000Z", "completeDate": "2015-04-28T15:02:06.073Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "349911", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR for Android: https://github.com/appcelerator/titanium_mobile/pull/6787\r\nTesting code:\r\n{code}\r\nfunction getData(section){\r\n var data = [];\r\n \r\n for (i=0;i<150;i++){\r\n data.push({\r\n template:Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT,\r\n properties: {\r\n title:'SECTION '+section+' ITEM '+i,\r\n searchableText: 'SECTION '+section+' ITEM '+i\r\n },\r\n });\r\n }\r\n return data;\r\n}\r\n\r\nfunction getSections(){\r\n //BOTH\r\n var section1 = Ti.UI.createListSection({\r\n headerTitle:'Section 0 Header',\r\n footerTitle:'Section 0 Footer'\r\n });\r\n //HEADER ONLY\r\n var section2 = Ti.UI.createListSection({\r\n headerTitle:'Section 1 Header'\r\n });\r\n //FOOTER ONLY\r\n var section3 = Ti.UI.createListSection({\r\n footerTitle:'Section 2 Footer'\r\n });\r\n //Neither\r\n var section4 = Ti.UI.createListSection();\r\n section1.setItems(getData(0));\r\n section2.setItems(getData(1));\r\n section3.setItems(getData(2));\r\n section4.setItems(getData(3));\r\n \r\n return [section1,section2,section3,section4];\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n title:'Headers & Footers'\r\n});\r\n \r\nvar platformName = Titanium.Platform.osname;\r\nvar isIOS = (platformName == 'iphone' || platformName == 'ipad');\r\n \r\nvar listView = Ti.UI.createListView({\r\n top: 20,\r\n caseInsensitiveSearch: true,\r\n sections:getSections(),\r\n headerTitle:'THIS IS LIST VIEW HEADER',\r\n footerTitle:'THIS IS LIST VIEW FOOTER. SHOULD BE AT BOTTOM'\r\n});\r\nlistView.addEventListener('marker', function(e) {\r\n\tTi.API.info(\"Marker fired: Section \" + e.sectionIndex + \", Item:\" + e.itemIndex);\r\n});\r\nwin.add(listView);\r\nlistView.addMarker({sectionIndex: 1, itemIndex: 4});\r\nlistView.addMarker({sectionIndex: 0, itemIndex: 80});\r\nwin.open();\r\n{code}\r\n\r\n1. Run code and scroll down, check logs to confirm the events are fired correctly.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-17T00:09:33.000+0000", "updated": "2015-04-17T00:09:33.000+0000" }, { "id": "350436", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR for iOS\r\nmaster - https://github.com/appcelerator/titanium_mobile/pull/6800", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-04-22T19:34:46.000+0000", "updated": "2015-04-22T19:34:46.000+0000" }, { "id": "355228", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix for both IOS and Android.\r\n\r\nMultiple markers are fired as expected in the console.\r\n\r\nClosing the feature.\r\n\r\n\r\nEnvironment:\r\nAppc Studio : 4.1.0.201505071004\r\nTi SDK : 4.1.0.v20150614181235\r\nTi CLI : 4.0.1\r\nAlloy : 1.6.2\r\nMAC Yosemite : 10.10.3\r\nAppc npm : 4.0.1\r\nAppc CLI : 4.0.2\r\nNode: v0.10.37\r\nNexus 6 - Android 5.0.1\r\nIphone Simulator : Iphone 5 IOS 8.3", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-16T16:56:22.000+0000", "updated": "2015-06-16T16:56:22.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }