[AC-2120] Android: TableView click on subview
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-02-05T00:08:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | parity |
Reporter | Martin Guillon |
Assignee | Mauro Parra-Miranda |
Created | 2012-10-14T17:19:26.000+0000 |
Updated | 2016-03-08T07:41:05.000+0000 |
Description
*Problem description*
Running the code below on iOS, you get TableView click when pressing on rows subviews. The event source is the subview but you still get the row property and the index. That's practical as you dont have to use "touchEnabled".
On Android you get the click event but not the row property. We should get that property too on android.
*Test case*
var win = Titanium.UI.createWindow();
win.backgroundColor = '#ccc';
var tableview = Ti.UI.createTableView();
win.add(tableview);
var rowData = [];
for (var i = 0; i < 10; i++) {
var row = Ti.UI.createTableViewRow({
title : 'row ' + i,
name : 'row ' + i
});
var view = Ti.UI.createView({
width : 100,
height : 30,
backgroundColor : 'blue'
})
row.add(view);
var view2 = Ti.UI.createLabel({
width : 50,
height : 30,
backgroundColor : 'red'
})
view.add(view2);
rowData.push(row);
};
tableview.data = rowData;
tableview.addEventListener('click', function(e) {
if (e.row)
alert('we got a row! ');
else
alert('we got a click but no row! ');
})
win.open();
Attachments
File | Date | Size |
---|---|---|
Screenshot_2_4_13_4_04_PM.png | 2013-02-05T00:07:56.000+0000 | 77321 |
Hi Martin, I tested this on the 4.0.3 android simulator and received a row on the click event, screenshot attached.
Did you click on a subview? Cause it s normal to see the dialog if you click on the row itself
Hi Martin, I tested this myself on an Android 2.3.3 device with 3.0 GA and 3.1 master, I also always get the row even when tapping on either subview... Edit: I guess I should test on a 4.0.3 device, but if it doesn't happen in the 4.0.3 emulator then... Edit2: Tested on a 4.2.1 device, still can't reproduce. I know it's not 4.0.3, but I'm not able to get my hands on that specific version right now. I'm going to conclude that it's very unlikely it will not work on 4.0.3. Maybe you have some custom code in your 3.1 build like you've realised in the past?
@Daniel: sorry it took me so long to respond. I you cant reproduce just close it :s I am really sorry it must have been fixed somewhere. I also remember fixing it myself, but it s too far down the road :s Sorry again