Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-767] Android: Missing Swipe Gesture

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2012-04-04T08:45:05.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.1.0, Sprint 2012-07
ComponentsAndroid
Labelsapi, parity
ReporterDon Thorp
AssigneeTony Lukasavage
Created2011-04-15T02:35:57.000+0000
Updated2013-05-17T08:23:38.000+0000

Description

See http://developer.appcelerator.com/question/14911/swipe-and-twofingertap-in-android"> Q&A

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

  1. hal 2011-04-15

    Note, this is similar to #767 and #768

  2. hal 2011-04-15

    /sigh, I meant #768 and #1703

  3. Don Thorp 2011-04-15

    Closed #1703 as duplicate. #768 is for two finger tap, so leaving it open as it's a separate item.

  4. Don Thorp 2011-04-15

    The swipe gesture is only available on ScrollableView at this time.

  5. jj 2011-04-15

    Swipe event does not fire in 1.5.1 on scrollableview for Android.

  6. 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);
       });
       
  7. 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

  8. 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

  9. 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)
  10. 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.
  11. 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
  12. Tony Lukasavage 2012-03-25

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/1835 (a good one this time)
  13. 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
  14. 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. });

JSON Source