Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1797] Android: touchcancel not firing when move touch off of view and over to empty window space

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:57:12.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M03
ComponentsAndroid
Labelsandroid, defect
ReporterBill Dawson
AssigneeDon Thorp
Created2011-04-15T03:02:40.000+0000
Updated2011-04-17T01:57:12.000+0000

Description

touchcancel not happening with this code, instead touchend is. I would expect that if you touch and hold on the view, then maintain the hold and drag off the view and release, you would get touchcancel instead of touchend. I'm getting touchend.


var notification = Ti.UI.createNotification({
    duration: Ti.UI.NOTIFICATION_DURATION_LONG
    
});
function showStatus(text)
{
    notification.hide();
    notification.message = text;
    notification.show();
}
var win = Ti.UI.currentWindow;

var events = '';
function showEventStream(thisevent) {
    if (events.length > 0) {
        events += "; ";
    }
    events += thisevent;
    showStatus(events);
}

var v = Ti.UI.createView({
    backgroundColor: 'blue',
    top: 10, left: 10, right: 10, height: 200
});
v.addEventListener('touchend', function(){
    showEventStream('touchend');
});
v.addEventListener('touchstart', function(){
    showEventStream('touchstart');
});
v.addEventListener('touchcancel', function(){
    showEventStream('touchcancel');
});
win.add(v);

Comments

  1. Don Thorp 2011-04-15

    (from [40e73fd2352ee01c7faa14af4651a53cfd78ba26]) [#1797 state:fixed-in-qa] added in rect detection to send touchcancel. Hours looking at source didn't provide a clue on why android isn't firing touchcancel outside of view. https://github.com/appcelerator/titanium_mobile/commit/40e73fd2352ee01c7faa14af4651a53cfd78ba26"> https://github.com/appcelerator/titanium_mobile/commit/40e73fd2352e...

  2. Matt Schmulen 2011-04-15

    Titanium SDK version: 1.5.0 (12/03/10 10:38 33c2058) custom, Android sim 1.6/2.1

JSON Source