-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TableView created programmatically not clickable #388
Comments
Hi The logs when I click on a Cell:
|
I will add this to documentation
|
As a temporary work around, I copied the source code for TableView to create my own table view class that has an extra constructor where you can pass in the boolean values to set those flags. This has to done in a constructor since those boolean flags are private. |
When a TableView is created with new TableView(context), i.e. not using XML, then it is not clickable.
Looking at the source for TableView (version 0.8.9.4) it seems like the flags to allow clicking are set to false by default:
private boolean mAllowClickInsideCell = false;
private boolean mAllowClickInsideRowHeader = false;
private boolean mAllowClickInsideColumnHeader = false;
When the TableView is inflated from XML these can be set
app:allow_click_inside_cell="true"
app:allow_click_inside_row_header="true"
app:allow_click_inside_column_header="true"
However they cannot be set programmatically, i.e. there are no setters for these fields. This is kinda understandable since they are used during initialization for the TableView, so really need another constructor to set them I guess.
FYI, I'm using new TableView(context) instead of XML since I'm embedding it in a compose AndroidView.
The text was updated successfully, but these errors were encountered: