[TIMOB-1797] Android: touchcancel not firing when move touch off of view and over to empty window space
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:57:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M03 |
Components | Android |
Labels | android, defect |
Reporter | Bill Dawson |
Assignee | Don Thorp |
Created | 2011-04-15T03:02:40.000+0000 |
Updated | 2011-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);
(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...
Titanium SDK version: 1.5.0 (12/03/10 10:38 33c2058) custom, Android sim 1.6/2.1