[TIMOB-1653] Android: Need support for Android long press event
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-07-19T17:03:30.000+0000 |
Affected Version/s | Release 1.6.2 |
Fix Version/s | Sprint 2011-29, Release 1.8.0 |
Components | Android |
Labels | klist |
Reporter | Dawson Toth |
Assignee | Bill Dawson |
Created | 2011-04-15T02:58:30.000+0000 |
Updated | 2012-02-08T17:55:31.000+0000 |
Description
It's not currently possible to add an event listener for a 'long press' event on Android (pressing and holding the finger on a widget for a second or two), which is very frequently used for things like context menus on Android.
In StatusNet Mobile's accounts list we're trying to use a long-click to trigger a context menu for controls such as deletion to provide a more native-feeling interface (on iPhone we use the TableView's native editing mode, which is iOS-specific).
Since the native event isn't available, for now we're trying to emulate it by listening for touchstart, touchend etc. This seems to interfere with the natural behavior of the tableview rows; here's the entry in our bug tracker for this:
http://status.net/open-source/issues/2571">http://status.net/open-source/issues/2571
On the Android side, SimpleGestureListener has an onLongPress stub method which could be overridden to fire a 'longpress' event; it looks like long press support might need to be activated on the GestureDetector by calling setIsLongpressEnabled (I'm uncertain what the default value is, but if it's on scroll events don't work, so perhaps it should only be set when a listener is present):
http://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener.html"> http://developer.android.com/reference/android/view/GestureDetector...
http://developer.android.com/reference/android/view/GestureDetector.html"> http://developer.android.com/reference/android/view/GestureDetector...
Attachments
File | Date | Size |
---|---|---|
app.js | 2011-07-18T16:06:42.000+0000 | 3771 |