[TIMOB-767] Android: Missing Swipe Gesture
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-04T08:45:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.1.0, Sprint 2012-07 |
Components | Android |
Labels | api, parity |
Reporter | Don Thorp |
Assignee | Tony Lukasavage |
Created | 2011-04-15T02:35:57.000+0000 |
Updated | 2013-05-17T08:23:38.000+0000 |
Description
Test Case
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
fullscreen: false,
exitOnClose: true
});
var view = Ti.UI.createView({
backgroundColor: '#a00',
height:200,
width:200
});
win.add(view);
view.addEventListener('swipe', function(e) {
alert(e.direction);
});
win.open();
Comments
- hal 2011-04-15
- hal 2011-04-15
- Don Thorp 2011-04-15
- Don Thorp 2011-04-15
The swipe gesture is only available on ScrollableView at this time.
- jj 2011-04-15
Swipe event does not fire in 1.5.1 on scrollableview for Android.
- skypanther 2011-04-15
Any updates? Swipe still doesn't fire on views or windows with 1.5.1 or 1.6 CI.
var swiped = 'none'; win.addEventListener('swipe', function(e){ Ti.API.info('swiping '+e.direction+' by '+e.source); if (e.direction != swiped) { Ti.API.info('now we should be swiping '+e.direction); swiped = e.direction; if (e.direction == 'left') { //stuff nextTab(); } else if (e.direction == 'right') { //stuff previousTab(); } } setTimeout(function() { swiped = 'none'; },2000); });
- the3dguy 2011-04-15
Any word on when this will be fixed? Swiping is really important on mobile. I'm using 1.5.1 and swiping is not working for a view, webview, imageview, or scrollableview
- Dawson Toth 2011-04-15
Workaround
Here is a workaround: https://gist.github.com/841075">https://gist.github.com/841075
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/75391">http://developer.appcelerator.com/helpdesk/view/75391
- Tony Lukasavage 2012-02-04 Submitted a pull request for native handling of swipe events, both horizontal and vertical, on Android views: [PR #1350](https://github.com/appcelerator/titanium_mobile/pull/1350)
- Nikolai Derzhak 2012-02-06 This issue latest notification was not sent due to JIRA mail setting. Fixed now. Please check the issue for latests changes.
- Tamila Smolich 2012-02-13 This bug still occurs in: Titanium SDK version: 1.9.0.v20120207124634 Javascript Engine: Rhino Platform & version/Device details: Android 3.1/LG-V909; Android 4.0.2/Galaxy Nexus; Android 2.3.4/HTC T-mobile; Android 3.2/Samsung GT-P7510 Titanium Studio version: 1.0.8.201201262211
- Tony Lukasavage 2012-03-25 Pull request: https://github.com/appcelerator/titanium_mobile/pull/1835 (a good one this time)
- Shyam Bhadauria 2012-06-05 Adding environment info- Tested with Titanium SDK: 2.1.0.v20120605190238 Tested with Titanium Studio: 2.1.0.201206041625 Device - Android 2.2 and 4.0 Galaxy nexus Android runtime - V8
- kent hao 2013-05-17 'swipe' is fired, but properties as 'row','index' are missing in the event. but in the document, it says 'swipe' event of the tableview has row/index properties. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableView-event-swipe tableView.addEventListener('swipe',function(e){ // e.row or e.index are not available for android. });