{ "id": "100380", "key": "AC-2417", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-12T22:09:00.000+0000", "created": "2012-09-04T07:34:34.000+0000", "labels": [ "ios", "pull", "refresh" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:27.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": [], "description": "This code\r\nhttp://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html\r\n\r\nOnly seems to work on the 2.1b SDK I have installed, using the new ones doesnt work correctly. The view slides up, then back down to refresh, then back up to hide.", "attachment": [], "flagged": false, "summary": "iOS: Pull to Refresh doesn't work in new SDK", "creator": { "name": "josh.lewis", "key": "josh.lewis", "displayName": "Josh Lewis", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "josh.lewis", "key": "josh.lewis", "displayName": "Josh Lewis", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mountain Lion / latest xcode / latest Titanium", "comment": { "comments": [ { "id": "223283", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "Check Kitchen Sink for the updated code.", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-10-12T18:10:10.000+0000", "updated": "2012-10-12T18:10:10.000+0000" }, { "id": "223316", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Latest code: https://github.com/appcelerator/KitchenSink/blob/master/Resources/ui/handheld/ios/baseui/table_view_pull_to_refresh.js\nCommit history: https://github.com/appcelerator/KitchenSink/commits/master/Resources/ui/handheld/ios/baseui/table_view_pull_to_refresh.js", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-12T22:08:39.000+0000", "updated": "2012-10-12T22:08:39.000+0000" }, { "id": "287364", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nI tested this issue with the test code below (modified kitchen sink project). I can't reproduce this issue in latest Ti builds.\r\n\r\nh5. Test Environment\r\n\r\nMac OS X 10.8.6\r\nTi SDK 3.2.0.GA\r\nTi CLI 3.2.0\r\nIOS simulator 7.0.3\r\n\r\n\r\n\r\n \r\n\r\nh5. Test Code \r\n\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#fff\",\r\n});\r\n\r\nfunction formatDate() {\r\n\tvar date = new Date();\r\n\tvar datestr = date.getMonth() + '/' + date.getDate() + '/' + date.getFullYear();\r\n\tif (date.getHours() >= 12) {\r\n\t\tdatestr += ' ' + (date.getHours() == 12 ? date.getHours() : date.getHours() - 12) + ':' + date.getMinutes() + ' PM';\r\n\t} else {\r\n\t\tdatestr += ' ' + date.getHours() + ':' + date.getMinutes() + ' AM';\r\n\t}\r\n\treturn datestr;\r\n}\r\n\r\nvar data = [{\r\n\ttitle : \"Row 1\"\r\n}, {\r\n\ttitle : \"Row 2\"\r\n}, {\r\n\ttitle : \"Row 3\"\r\n}];\r\n\r\nvar lastRow = 4;\r\n\r\nvar tableView = Ti.UI.createTableView({\r\n\tdata : data\r\n});\r\n\r\nwin.add(tableView);\r\n\r\nvar border = Ti.UI.createView({\r\n\tbackgroundColor : \"#576c89\",\r\n\theight : 2,\r\n\tbottom : 0\r\n});\r\n\r\nvar tableHeader = Ti.UI.createView({\r\n\tbackgroundColor : \"#e2e7ed\",\r\n\twidth : 320,\r\n\theight : 60\r\n});\r\n\r\n// fake it til ya make it.. create a 2 pixel\r\n// bottom border\r\ntableHeader.add(border);\r\n\r\nvar arrow = Ti.UI.createView({\r\n\tbackgroundImage : \"/images/whiteArrow.png\",\r\n\twidth : 23,\r\n\theight : 60,\r\n\tbottom : 10,\r\n\tleft : 20\r\n});\r\n\r\nvar statusLabel = Ti.UI.createLabel({\r\n\ttext : \"Pull to reload\",\r\n\tleft : 55,\r\n\twidth : 200,\r\n\tbottom : 30,\r\n\theight : \"auto\",\r\n\tcolor : \"#576c89\",\r\n\ttextAlign : \"center\",\r\n\tfont : {\r\n\t\tfontSize : 13,\r\n\t\tfontWeight : \"bold\"\r\n\t},\r\n\tshadowColor : \"#999\",\r\n\tshadowOffset : {\r\n\t\tx : 0,\r\n\t\ty : 1\r\n\t}\r\n});\r\n\r\nvar lastUpdatedLabel = Ti.UI.createLabel({\r\n\ttext : \"Last Updated: \" + formatDate(),\r\n\tleft : 55,\r\n\twidth : 200,\r\n\tbottom : 15,\r\n\theight : \"auto\",\r\n\tcolor : \"#576c89\",\r\n\ttextAlign : \"center\",\r\n\tfont : {\r\n\t\tfontSize : 12\r\n\t},\r\n\tshadowColor : \"#999\",\r\n\tshadowOffset : {\r\n\t\tx : 0,\r\n\t\ty : 1\r\n\t}\r\n});\r\n\r\nvar actInd = Titanium.UI.createActivityIndicator({\r\n\tleft : 20,\r\n\tbottom : 13,\r\n\twidth : 30,\r\n\theight : 30\r\n});\r\n\r\ntableHeader.add(arrow);\r\ntableHeader.add(statusLabel);\r\ntableHeader.add(lastUpdatedLabel);\r\ntableHeader.add(actInd);\r\n\r\ntableView.headerPullView = tableHeader;\r\n\r\nvar pulling = false;\r\nvar reloading = false;\r\n\r\nfunction beginReloading() {\r\n\t// just mock out the reload\r\n\tsetTimeout(endReloading, 2000);\r\n}\r\n\r\nfunction endReloading() {\r\n\t// simulate loading\r\n\tfor (var c = lastRow; c < lastRow + 10; c++) {\r\n\t\ttableView.appendRow({\r\n\t\t\ttitle : \"Row \" + c\r\n\t\t});\r\n\t}\r\n\tlastRow += 10;\r\n\r\n\t// when you're done, just reset\r\n\ttableView.setContentInsets({\r\n\t\ttop : 0\r\n\t}, {\r\n\t\tanimated : true\r\n\t});\r\n\treloading = false;\r\n\tlastUpdatedLabel.text = \"Last Updated: \" + formatDate();\r\n\tstatusLabel.text = \"Pull down to refresh...\";\r\n\tactInd.hide();\r\n\tarrow.show();\r\n}\r\n\r\ntableView.addEventListener('scroll', function(e) {\r\n\tvar offset = e.contentOffset.y;\r\n\tif (offset <= -65.0 && !pulling && !reloading) {\r\n\t\tvar t = Ti.UI.create2DMatrix();\r\n\t\tt = t.rotate(-180);\r\n\t\tpulling = true;\r\n\t\tarrow.animate({\r\n\t\t\ttransform : t,\r\n\t\t\tduration : 180\r\n\t\t});\r\n\t\tstatusLabel.text = \"Release to refresh...\";\r\n\t} else if (pulling && (offset > -65.0 && offset < 0) && !reloading) {\r\n\t\tpulling = false;\r\n\t\tvar t = Ti.UI.create2DMatrix();\r\n\t\tarrow.animate({\r\n\t\t\ttransform : t,\r\n\t\t\tduration : 180\r\n\t\t});\r\n\t\tstatusLabel.text = \"Pull down to refresh...\";\r\n\t}\r\n});\r\n\r\nvar event1 = 'dragEnd';\r\nif (Ti.version >= '3.0.0') {\r\n\tevent1 = 'dragend';\r\n}\r\n\r\ntableView.addEventListener(event1, function(e) {\r\n\tif (pulling && !reloading) {\r\n\t\treloading = true;\r\n\t\tpulling = false;\r\n\t\tarrow.hide();\r\n\t\tactInd.show();\r\n\t\tstatusLabel.text = \"Reloading...\";\r\n\t\ttableView.setContentInsets({\r\n\t\t\ttop : 60\r\n\t\t}, {\r\n\t\t\tanimated : true\r\n\t\t});\r\n\t\tarrow.transform = Ti.UI.create2DMatrix();\r\n\t\tbeginReloading();\r\n\t}\r\n});\r\nwin.open();\r\n{code}\r\n\r\n\r\nThnaks ", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-09T03:55:11.000+0000", "updated": "2014-01-15T19:03:34.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }