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) { // 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); }
protected internal override void LongPressAction(MotionEvent e) { // Consume the action for the time when either the cell row recyclerView or // the cell recyclerView is scrolling. if ((mRecyclerView.ScrollState != RecyclerView.ScrollStateIdle) || (mCellRecyclerView.ScrollState != RecyclerView.ScrollStateIdle)) { return; } // Get interacted view from x,y coordinate. Android.Views.View child = mRecyclerView.FindChildViewUnder(e.GetX(), e.GetY()); if (child != null && GetTableViewListener() != null) { // Find the view holder RecyclerView.ViewHolder holder = mRecyclerView.GetChildViewHolder(child); // Get y position from adapter CellRowRecyclerViewAdapter adapter = (CellRowRecyclerViewAdapter)mRecyclerView.GetAdapter(); // Call ITableView listener for long click GetTableViewListener().OnCellLongPressed(holder, holder.AdapterPosition, adapter.GetYPosition()); } }