Closed vkhaitan closed 5 years ago
Okay. It was working in 0.8.6 . It stopped working after that. I find that you did some changes to fix #133 and that fix created this new issue. Need another fix now.
Okay. So I fixed it in my C# source code. Basically you just forgot to update other files in fix of #133 . e.g. In ClickAction() function
protected internal override bool ClickAction(RecyclerView view, MotionEvent e)
{
// Get interacted view from x,y coordinate.
Android.Views.View childView = view.FindChildViewUnder(e.GetX(), e.GetY());
if (childView != null && mGestureDetector.OnTouchEvent(e))
{
// Find the view holder
AbstractViewHolder holder = (AbstractViewHolder) mRecyclerView.GetChildViewHolder(childView);
// Get y position from adapter
CellRowRecyclerViewAdapter adapter = (CellRowRecyclerViewAdapter) mRecyclerView.GetAdapter();
int column = holder.AdapterPosition;
int row = adapter.GetYPosition();
// Control to ignore selection color
if (!mTableView.IsIgnoreSelectionColors())
{
mSelectionHandler.SetSelectedCellPositions(holder, column, row);
}
if (GetTableViewListener() != null)
{
// Call ITableView listener for item click
GetTableViewListener().OnCellClicked(holder, column, row);
}
return true;
}
return false;
}
In this code mGestureDetector.OnTouchEvent(e)
is spurious now, since you are already calling it in Listener interface. You need to remove it all 3 files, then commit. I did it for myself in C# code and after that correct methods are being called.
Okay, I just found that there is already a pull request for this via #181 . So marking it closed.
I find it quite strange that OnColumnHeaderClicked listener is not called when column is touched. Instead the LongPressed version is called. You tableviewsampleapp too execute code in LongPress listener. Why did you not write code in Clicked version, instead of LongPress ? Why Clicked version is not even called ?