{ "id": "112288", "key": "TIMOB-13418", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "111848", "key": "TIMOB-13246", "fields": { "summary": "iOS: Implement ListView Phase 2", "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": "Critical", "id": "1" }, "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": "15499", "description": "2013 Sprint 13 API", "name": "2013 Sprint 13 API", "archived": true, "released": true, "releaseDate": "2013-07-01" }, { "id": "15111", "description": "2013 Sprint 13", "name": "2013 Sprint 13", "archived": true, "released": true, "releaseDate": "2013-07-01" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-06-24T23:46:14.000+0000", "created": "2013-04-05T22:34:12.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T18:32:49.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "will require API/events discussion.", "attachment": [], "flagged": false, "summary": "ListView: Pull-to-refresh support", "creator": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "258618", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "ListView changes\r\n\r\nNew property - pullView (replaces headerPullView)\r\nNew events - pull (e.active = true/false), pullend (fired on dragend when pull is active)\r\n\r\nOn iOS we will also need to add support to set contentInsets on the listView to keep the pullView visible while data is being updated and then setting it back to (0,0).\r\n\r\n", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-19T21:02:08.000+0000", "updated": "2013-06-20T21:46:08.000+0000" }, { "id": "258831", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Test Code\n{code}\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\nvar listView = Ti.UI.createListView({height:'90%', top:0});\nvar sections = [];\n\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});\nvar fruitDataSet = [\n {properties: { title: 'Apple'}},\n {properties: { title: 'Banana'}},\n {properties: { title: 'Cantaloupe'}},\n {properties: { title: 'Fig'}},\n {properties: { title: 'Guava'}},\n {properties: { title: 'Kiwi'}},\n];\nfruitSection.setItems(fruitDataSet);\nsections.push(fruitSection);\n\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});\nvar vegDataSet = [\n {properties: { title: 'Carrots'}},\n {properties: { title: 'Potatoes'}},\n {properties: { title: 'Corn'}},\n {properties: { title: 'Beans'}},\n {properties: { title: 'Tomato'}},\n];\nvegSection.setItems(vegDataSet);\n\n\nvar fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});\nvar fishDataSet = [\n {properties: { title: 'Cod'}},\n {properties: { title: 'Haddock'}},\n {properties: { title: 'Salmon'}},\n {properties: { title: 'Tuna'}},\n];\nfishSection.setItems(fishDataSet);\n\n\nlistView.sections = sections;\n\n\nvar refreshCount = 0;\n\nfunction getFormattedDate(){\n var date = new Date();\n return date.getMonth() + '/' + date.getDate() + '/' + date.getFullYear() + ' ' + date.getHours() + ':' + date.getMinutes();\n}\n\n\nfunction resetPullHeader(){\n actInd.hide();\n imageArrow.transform=Ti.UI.create2DMatrix();\n if (refreshCount < 2) {\n imageArrow.show();\n labelStatus.text = 'Pull down to refresh...';\n labelLastUpdated.text = 'Last Updated: ' + getFormattedDate();\n } else {\n labelStatus.text = 'Nothing To Refresh';\n labelLastUpdated.text = 'Go Cook Something';\n listView.removeEventListener('pull', pullListener);\n listView.removeEventListener('pullend', pullendListener);\n eventStatus.text = 'Removed event listeners.';\n }\n listView.setContentInsets({top:0}, {animated:true});\n}\n\nfunction loadTableData()\n{\n if (refreshCount == 0) {\n listView.appendSection(vegSection);\n } else if (refreshCount == 1) {\n listView.appendSection(fishSection);\n } \n refreshCount ++;\n resetPullHeader();\n}\n\nfunction pullListener(e){\n eventStatus.text = 'EVENT pull FIRED. e.active = '+e.active;\n if (e.active == false) {\n var unrotate = Ti.UI.create2DMatrix();\n imageArrow.animate({transform:unrotate, duration:180});\n labelStatus.text = 'Pull down to refresh...';\n } else {\n var rotate = Ti.UI.create2DMatrix().rotate(180);\n imageArrow.animate({transform:rotate, duration:180});\n if (refreshCount == 0) {\n labelStatus.text = 'Release to get Vegetables...';\n } else {\n labelStatus.text = 'Release to get Fish...';\n }\n }\n}\n\nfunction pullendListener(e){\n eventStatus.text = 'EVENT pullend FIRED.';\n\n if (refreshCount == 0) {\n labelStatus.text = 'Loading Vegetables...'; \n } else {\n labelStatus.text = 'Loading Fish...';\n }\n imageArrow.hide();\n actInd.show();\n listView.setContentInsets({top:80}, {animated:true});\n setTimeout(function(){\n loadTableData();\n }, 2000);\n}\n\nvar tableHeader = Ti.UI.createView({\n backgroundColor:'#e2e7ed',\n width:320, height:80\n});\n \nvar border = Ti.UI.createView({\n backgroundColor:'#576c89',\n bottom:0,\n height:2\n});\ntableHeader.add(border);\n \nvar imageArrow = Ti.UI.createImageView({\n image:'https://github.com/appcelerator/titanium_mobile/raw/master/demos/KitchenSink/Resources/images/whiteArrow.png',\n left:20, bottom:10,\n width:23, height:60\n});\ntableHeader.add(imageArrow);\n \nvar labelStatus = Ti.UI.createLabel({\n color:'#576c89',\n font:{fontSize:13, fontWeight:'bold'},\n text:'Pull down to refresh...',\n textAlign:'center',\n left:55, bottom:30,\n width:200\n});\ntableHeader.add(labelStatus);\n \nvar labelLastUpdated = Ti.UI.createLabel({\n color:'#576c89',\n font:{fontSize:12},\n text:'Last Updated: ' + getFormattedDate(),\n textAlign:'center',\n left:55, bottom:15,\n width:200\n});\ntableHeader.add(labelLastUpdated);\n \nvar actInd = Ti.UI.createActivityIndicator({\n left:20, bottom:13,\n width:30, height:30\n});\ntableHeader.add(actInd);\n\n\nlistView.pullView = tableHeader;\n\nlistView.addEventListener('pull', pullListener);\n\nlistView.addEventListener('pullend',pullendListener);\n\n\nvar eventStatus = Ti.UI.createLabel({\n font:{fontSize:13, fontWeight:'bold'},\n text: 'Event data will show here',\n bottom:0,\n height:'10%'\n})\n\nwin.add(listView);\nwin.add(eventStatus);\nwin.open();\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-20T21:46:44.000+0000", "updated": "2013-06-20T21:46:44.000+0000" }, { "id": "258838", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending against master\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4407", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-20T21:54:24.000+0000", "updated": "2013-06-20T21:54:24.000+0000" }, { "id": "259305", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@vishalduggal shouldn't we add this test case to KS ?", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-24T23:46:14.000+0000", "updated": "2013-06-24T23:46:14.000+0000" }, { "id": "414284", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T18:32:49.000+0000", "updated": "2017-03-21T18:32:49.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }