{ "id": "62285", "key": "TIMOB-1653", "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": "11361", "description": "Mobile 1.8.0 M08", "name": "Sprint 2011-29", "archived": true, "released": true, "releaseDate": "2011-07-25" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-07-19T17:03:30.000+0000", "created": "2011-04-15T02:58:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "klist" ], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [ { "id": "14481", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "84500", "key": "TIDOC-164", "fields": { "summary": "APIDoc: UI.TableView and TableViewRow- document supported events per platform", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2012-02-08T17:55:31.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": "{html}

It's not currently possible to add an event listener for a 'long\r\npress' event on Android (pressing and holding the finger on a\r\nwidget for a second or two), which is very frequently used for\r\nthings like context menus on Android.

\r\n

In StatusNet Mobile's accounts list we're trying to use a\r\nlong-click to trigger a context menu for controls such as deletion\r\nto provide a more native-feeling interface (on iPhone we use the\r\nTableView's native editing mode, which is iOS-specific).

\r\n

Since the native event isn't available, for now we're trying to\r\nemulate it by listening for touchstart, touchend etc. This seems to\r\ninterfere with the natural behavior of the tableview rows; here's\r\nthe entry in our bug tracker for this:

\r\n

http://status.net/open-source/issues/2571

\r\n

On the Android side, SimpleGestureListener has an onLongPress\r\nstub method which could be overridden to fire a 'longpress' event;\r\nit looks like long press support might need to be activated on the\r\nGestureDetector by calling setIsLongpressEnabled (I'm uncertain\r\nwhat the default value is, but if it's on scroll events don't work,\r\nso perhaps it should only be set when a listener is present):

\r\n

\r\nhttp://developer.android.com/reference/android/view/GestureDetector...

\r\n

\r\nhttp://developer.android.com/reference/android/view/GestureDetector...

{html}", "attachment": [ { "id": "21877", "filename": "app.js", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-07-18T16:06:42.000+0000", "size": 3771, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Need support for Android long press event", "creator": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "126288", "author": { "name": "zipcar(goss)", "key": "zipcar(goss)", "displayName": "Zipcar (Goss)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

What's the status of this?

{html}", "updateAuthor": { "name": "zipcar(goss)", "key": "zipcar(goss)", "displayName": "Zipcar (Goss)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:58:31.000+0000", "updated": "2011-04-15T02:58:31.000+0000" }, { "id": "156438", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Updated priority to match this tickets dependency, [TIMOB-3492]. Both have a decent amount of interest from customers now.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-06-10T07:28:02.000+0000", "updated": "2011-06-10T07:28:02.000+0000" }, { "id": "157134", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "h2. Sample Code\r\nThe following code is an example of how we could utilize the long press from JavaScript. Drop it in an app.js and long press the label! (Hold down on the label for a couple of seconds, and an alert would be displayed.)\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\nvar label = Ti.UI.createLabel({\r\n text:'Long press this label, I dare you.',\r\n height:'auto',\r\n backgroundColor:'red'\r\n});\r\nwin.add(label);\r\nlabel.addEventListener('longpress', function(evt) {\r\n alert('PASS: You long pressed the label!');\r\n});\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-06-20T08:31:45.000+0000", "updated": "2011-06-20T08:31:45.000+0000" }, { "id": "158904", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Though we can (and will, via this ticket) provide longpress events, isn't the real issue that we should support registering context menus on views? Because for the real native experience you'd want a true Android context menu.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-07-07T08:27:17.000+0000", "updated": "2011-07-07T08:27:17.000+0000" }, { "id": "158906", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "@Bill: yup; [TIMOB-3492]", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-07-07T08:30:54.000+0000", "updated": "2011-07-07T08:30:54.000+0000" }, { "id": "159863", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "longpress and longclick added.\r\n\r\nTESTING NOTES:\r\n\r\n* KitchenSink: Base UI -> Window Events has a longpress test.\r\n* KitchenSink: Base UI -> Views -> Table Views -> Basic has longclick events on the tableview rows.\r\n* The attached app.js is the test app I used while developing this. It's got a few touch-related events on each of the views/controls that it displays. But it only shows the results via log messages, so you'll have to use logcat to use it.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-07-18T16:06:12.000+0000", "updated": "2011-07-18T16:06:12.000+0000" }, { "id": "159864", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "The app I used for testing while developing. (see attached app.js)", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-07-18T16:06:42.000+0000", "updated": "2011-07-18T16:07:03.000+0000" }, { "id": "159993", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "code review and functional test.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-19T17:03:30.000+0000", "updated": "2011-07-19T17:03:30.000+0000" }, { "id": "170784", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "What about long press for iOS?", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2011-10-28T12:34:08.000+0000", "updated": "2011-10-28T12:34:08.000+0000" }, { "id": "170790", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "longpress was added to iOS in TIMOB-4508", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-28T13:13:50.000+0000", "updated": "2011-10-28T13:13:50.000+0000" }, { "id": "179761", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "But no longpress event at the TableView level? Please add it.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-01-18T13:13:44.000+0000", "updated": "2012-01-18T13:13:44.000+0000" }, { "id": "182523", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 1.0.8.201201262211\r\nTi Mob SDK 1.9.0.v20120207171634\r\nOSX Lion 10.7.3\r\nNexus S OS 2.3.6 v8/rhino\r\n\r\nVerified that long press events are implemented and work correctly", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-08T17:55:31.000+0000", "updated": "2012-02-08T17:55:31.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }