[TIMOB-11050] Android: x & y of click event aren't passed to callback
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2013-06-18T22:12:53.000+0000 |
| Affected Version/s | Release 2.1.3, Release 3.1.0 |
| Fix Version/s | 2013 Sprint 12 API, 2013 Sprint 12 |
| Components | Android |
| Labels | exalture, ipass1, tableview |
| Reporter | Mitchell Amihod |
| Assignee | Sunila |
| Created | 2012-09-18T21:01:53.000+0000 |
| Updated | 2017-03-30T17:26:19.000+0000 |
Description
The callback for click event on tableview isn't receiving x & y coords as described in docs on android. Works on iOS just fine.
http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.TableView-event-click
Attachments
| File | Date | Size |
|---|---|---|
| app.js | 2012-09-18T21:01:53.000+0000 | 307 |
| Screen Shot 2013-03-21 at 2.45.50 PM.png | 2013-03-21T09:21:32.000+0000 | 421911 |
| Screen Shot 2013-03-21 at 2.46.05 PM.png | 2013-03-21T09:21:32.000+0000 | 473598 |
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 iOS iPhone Simulator: iOS SDK version: 6.0 jithinpv
Filled x,y values in rowClicked https://github.com/appcelerator/titanium_mobile/pull/4145
The docs say that this is not supported in 3.X http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableView-event-click IF we do implement this, it should match iOS so that the x & y should be relative to the row (most likely bubbled up from the row).
Test case for this:
var win = Titanium.UI.createWindow(); var table = Ti.UI.createTableView(); var row = Ti.UI.createTableViewRow({ title : 'rowtitle', hasChild : true }); var row1 = Ti.UI.createTableViewRow({ title : 'rowtitle', hasChild : true }); var row2 = Ti.UI.createTableViewRow({ title : 'rowtitle', hasChild : true }); var row3 = Ti.UI.createTableViewRow({ title : 'rowtitle', hasChild : true }); var label = Ti.UI.createLabel({ text : 'this is a label', backgroundColor : 'yellow' }); label.addEventListener('click', function(e) { Ti.API.info('---------label------- keys: ' + Object.keys(e)); Ti.API.info('--------label--------- x: ' + e.x); Ti.API.info('--------label--------- y: ' + e.y); }); row3.addEventListener('click', function(e) { Ti.API.info('---------row-------- keys: ' + Object.keys(e)); Ti.API.info('---------row-------- x: ' + e.x); Ti.API.info('--------row--------- y: ' + e.y); }); row.add(label); table.setData([row, row1, row2, row3]); table.addEventListener('click', function(e) { Ti.API.info('---------table------- keys: ' + Object.keys(e)); Ti.API.info('---------table-------- x: ' + e.x); Ti.API.info('--------table--------- y: ' + e.y); }); win.add(table); win.open();Marking as invalid since those properties aren't documented to work in android.
Closing ticket as invalid.