Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11841] Android: 'longclick' event data not filled (x, y ...)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2013-03-18T14:20:16.000+0000
Affected Version/sRelease 2.1.4, Release 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsexalture, triage
ReporterMartin Guillon
AssigneeSunila
Created2012-10-16T11:14:14.000+0000
Updated2017-03-22T21:50:17.000+0000

Description

*Actual behavior* The event data for 'longclick' is not filled, it returns nothing {} (see logs). *Expected behavior* The event data should return values like x, y etc. *Test case*
var win = Ti.UI.createWindow();
win.backgroundColor = 'white';
var view = Ti.UI.createView({
	backgroundColor:'red',
	width:200,
	height:200
})

view.addEventListener('longclick', function(e){
	Ti.API.info(JSON.stringify(e))
})

win.add(view);
win.open();
*Log*
[INFO][TiAPI   (  448)]  {"type":"longclick","source":{"children":[],"width":200,"keepScreenOn":false,"height":200,"backgroundRepeat":false,"backgroundColor":"red","rect":{"height":200,"y":289,"x":140,"width":200},"bubbleParent":true,"size":{"height":200,"y":0,"width":200,"x":0},"_events":{"longclick":{}}},"bubbles":true,"cancelBubble":false}

Comments

  1. Martin Guillon 2012-10-16

    pul request https://github.com/appcelerator/titanium_mobile/pull/3247
  2. Daniel Sefton 2012-11-21

    Tested and confirmed on Samsung Galaxy S2 2.3.6 device and Android emulator 2.3.3 on both 2.1.4 GA and latest 3.0.0 build.
  3. Lorenzo 2012-12-12

    Same problem here, Galaxy Nexus android 4.2 latest 3.0.0 beta2 e.row.id is undefined on longclick.
  4. Carlo Hermus 2013-02-13

    Can you please give us an ETA?
  5. Sunila 2013-03-18

    As per the documentation longClick event doesn't have x and y. Here is the description from documentation "As the trackball can fire this event, it is not intended to return the x and y coordinates of the touch, even when it is generated by the touchscreen."
  6. Martin Guillon 2013-03-18

    not the kind of answer you would expect! If thats your choice, will still keep it in my branch as IT IS very useful
  7. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to previous comments.

JSON Source