[TIMOB-1869] Android: Implement TableView.selectRow
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-11-12T20:18:03.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Sprint 2012-16 API, Release 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21 |
Components | Android |
Labels | api, module_tableview, parity, qe-and100112, qe-review, qe-testadded, triage |
Reporter | Don Thorp |
Assignee | Ping Wang |
Created | 2011-04-15T03:04:22.000+0000 |
Updated | 2013-04-29T16:44:22.000+0000 |
Description
See http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableView.selectRow-method.html
HD ticket: appc.me/c/APP-612663
PR: https://github.com/appcelerator/titanium_mobile/pull/2674
Test Case:
PR https://github.com/appcelerator/titanium_mobile/pull/2674
The behaviour on iOS and Android for TableView.selectRow are different. On Android the selected row is shown at the top of the screen whereas on iOS it is shown selected with blue background color. Verified on: Titanium Studio: 2.1.2.201208281351 Titanium SDK: 2.2.0.v20120828153312
Reopening issue. TableView.selectRow does not work on Android, but works fine on iOS. Tested and verified on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 3.0.0.201210090117 Titanium SDK, build: 3.0.0.v20121014234610 Device: Nexus 7 (4.1.2)
Please read documentation attached. From docs - Sets the currently selected item. If in touch mode, the item will not be selected but it will still be positioned appropriately. If the specified selection position is less than 0, then the item at position 0 will be selected. The method only guarantees that the selected row will be visible on the screen. Modify the test case to add maybe 200 rows and try selecting something off the screen. The row should be visible on screen.
Expecting behavior is shown with modified test case. Closing the bug.
This fix is already in 3_0_X branch. So removed the label merge-3.0.0.
Reopen to modify the label.
How can I change the background of selected rows? selectedBackgroundColor is not working here (3.1.0.GA).
Hi Rafael Kellermann Streit, calling tableview.selectRow(int) does not mean the row is selected. From the [doc](http://developer.android.com/reference/android/widget/ListView.html#setSelection(int)): {quote} If in touch mode, the item will not be selected but it will still be positioned appropriately. {quote} That's why selectedBackgroundColor is not shown in this case.
Hi Ping, thanks for your answer. How can I select a row changing the backgroundColor? Is it possible?