evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.14k stars 454 forks source link

ClickListener can not respond to click events correctly #346

Open Joker-zou opened 3 years ago

Joker-zou commented 3 years ago

Hi, I have some trouble in clicklistener,it seems to can not respond to click events correctly in the newest version(0.8.9.2).

The code in constructor can be run,but code in all listeners like onCellClicked,onColumnHeaderClicked and other of them will do nothing. Just like this public MyTableViewListener(Context context){ this.context = context; //can run Toast.makeText(context, "entry listener", Toast.LENGTH_SHORT).show(); } @Override public void onCellClicked(@NonNull RecyclerView.ViewHolder cellView, int columnPosition, int rowPosition) { //can not run Toast.makeText(context, "click", Toast.LENGTH_SHORT).show(); }

But I notice that another older version can correctly response all click events. (about 10/2017)

So I don't know if I'm using it the wrong way,can you help me solve this problem? thanks~

spencerhowell commented 3 years ago

I am having a similar issue, but only with onCellClicked. onColumnHeaderClicked and onRowHeaderClicked are working as expected.

sajaljain commented 3 years ago

@spencerhowell I am facing similar issue, @evrencoskun please suggest from work around

MGaetan89 commented 3 years ago

@Joker-zou @spencerhowell @sajaljain if I remember correctly, there was a change of behaviour introduced in version 0.8.9.2. Can you try to add any of these on your TableView to see if it works:

app:allow_click_inside_cell="true"
app:allow_click_inside_row_header="true"
app:allow_click_inside_column_header="true"
gaochuntie commented 1 year ago

@Joker-zou @spencerhowell @sajaljain if I remember correctly, there was a change of behaviour introduced in version 0.8.9.2. Can you try to add any of these on your TableView to see if it works:

app:allow_click_inside_cell="true"
app:allow_click_inside_row_header="true"
app:allow_click_inside_column_header="true"

Yes,it works