Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8326] Android: Regression: TableView no longer responds to touch events (touchstart, touchmove, touchend, touchcancel)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-13T18:12:52.000+0000
Affected Version/sRelease 2.0.0, Release 1.8.1
Fix Version/sRelease 2.1.0, Sprint 2012-08
ComponentsAndroid
Labelsapi, module_tableview, parity, qe-testadded, regression
ReporterShawn Lipscomb
AssigneeJosh Roesslein
Created2012-02-10T07:39:52.000+0000
Updated2012-07-11T10:18:00.000+0000

Description

Problem

TableView does not respond to touch events (touchstart, touchmove, touchend, touchcancel). This is a regression, as this worked fine in 1.7.5 and the 1.8.0.v... continuous build from September. This also works fine in iOS. Only Android is affected.

Test Case

drop the following app.js code into a new project

build with SDK 1.8.1

run on the Android 2.2 emulator

press and hold any row. *No touchstart event occurs.*

while still holding the row, move the mouse around a little. *No touchmove event occurs.*

let go of the row. *No touchend event occurs.*

var win1=Ti.UI.createWindow({
            backgroundColor:'#fff',
            exitOnClose:true,
            layout:'vertical',
            navBarHidden:false,
            backgroundColor:'black'
         });

var TopLabel=Ti.UI.createLabel({text:'Last row will only be half visible when scrolled',
                                color:'black',
                                left:0,
                                right:0,
                                height:25,
                                backgroundColor:'yellow'});

win1.add(TopLabel);

var MyListbox=Ti.UI.createTableView({backgroundColor:'black'});

for (var i=1; (i <= 10); i++)
  MyListbox.appendRow(Ti.UI.createTableViewRow({title:'Row '+i}));

Ti.API.info('adding EventListener for touchstart');
MyListbox.addEventListener('touchstart',TchStart);
function TchStart(evt)
{
  Ti.API.info('TchStart');
}

Ti.API.info('adding EventListener for touchmove');
MyListbox.addEventListener('touchmove',TchMove);
function TchMove(evt)
{
  Ti.API.info('TchMove');
}

Ti.API.info('adding EventListener for touchend');
MyListbox.addEventListener('touchend',TchEnd);
function TchEnd(evt)
{
  Ti.API.info('TchEnd');
}

Ti.API.info('adding EventListener for touchcancel');
MyListbox.addEventListener('touchcancel',TchCancel);
function TchCancel(evt)
{
  Ti.API.info('TchCancel');
}

Ti.API.info('adding EventListener for click');
MyListbox.addEventListener('click',LBClick);
function LBClick(evt)
{
  Ti.API.info('LBClick');
}

win1.add(MyListbox);
win1.open();

Comments

  1. Shawn Lipscomb 2012-03-27

    With SDK 2.0.0.v20120325213306, same results. However, if you add a 'longclick' listener, then when you hold down a row you get a full screen of this error repeating:
       !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
       
    in the console. And 'longclick' fires whether you continue holding down the row or just hold it down for a little longer than normal. This doesn't really give a good way to handle what is really a 'longpress' (but 'longpress' doesn't fire for Android.
  2. Junaid Younus 2012-03-27

    I can confirm that this bug exists and needs to be addressed asap. Tested on a HTC Sensation running Android 2.3.x. I wasn't able to get the issue with the 'long press' in the latest CI build, however I could reproduce all the issues in the original description.
  3. Junaid Younus 2012-03-27

    To be clear, I mean I'm unable to reproduce the 'full screen error' that Shawn is getting. However I'm able to confirm that I don't see any longpress events get fired at all.
  4. Shawn Lipscomb 2012-04-03

    HD ticket: http://support.appcelerator.com/tickets/APP-293867
  5. Josh Roesslein 2012-04-12

    Submitted [PR #1990](https://github.com/appcelerator/titanium_mobile/pull/1990) to resolve issue.
  6. Shawn Lipscomb 2012-04-17

    Verified fixed in SDK 2.1.0.v20120416160358. Thanks!
  7. Eric Merriman 2012-06-19

    Verified touchstart, move, end and cancel work as expected with SDK 2.1.0.v20120618154152.

JSON Source