public virtual void OnViewAttachedToWindow(AbstractViewHolder viewHolder) { AbstractViewHolder.SelectionState selectionState = mTableView.GetSelectionHandler().GetColumnSelectionState(viewHolder.AdapterPosition); // Control to ignore selection color if (!mTableView.IsIgnoreSelectionColors()) { // Change background color of the view considering it's selected state mTableView.GetSelectionHandler() .ChangeColumnBackgroundColorBySelectionStatus(viewHolder, selectionState); } // Change selection status viewHolder.SetSelected(selectionState); // Control whether the TableView is sortable or not. if (mTableView.IsSortable()) { if (viewHolder is AbstractSorterViewHolder) { // Get its sorting state SortState state = GetColumnSortHelper().GetSortingStatus(viewHolder.AdapterPosition); // Fire onSortingStatusChanged ((AbstractSorterViewHolder)viewHolder).OnSortingStatusChanged(state); } } }
public virtual void OnViewAttachedToWindow(AbstractViewHolder viewHolder) { base.OnViewAttachedToWindow(viewHolder); AbstractViewHolder.SelectionState selectionState = mTableView.GetSelectionHandler().GetRowSelectionState(viewHolder.AdapterPosition); // Control to ignore selection color if (!mTableView.IsIgnoreSelectionColors()) { // Change background color of the view considering it's selected state mTableView.GetSelectionHandler().ChangeRowBackgroundColorBySelectionStatus(viewHolder, selectionState); } // Change selection status viewHolder.SetSelected(selectionState); }
public AbstractItemClickListener(CellRecyclerView recyclerView, ITableView tableView) { this.mRecyclerView = recyclerView; this.mTableView = tableView; this.mSelectionHandler = tableView.GetSelectionHandler(); mGestureDetector = new GestureDetector(mRecyclerView.Context, new _SimpleOnGestureListener_46(this)); }
public virtual void OnViewAttachedToWindow(AbstractViewHolder holder) { base.OnViewAttachedToWindow(holder); CellRecyclerViewAdapter.CellRowViewHolder viewHolder = (CellRecyclerViewAdapter.CellRowViewHolder)holder; ScrollHandler scrollHandler = mTableView.GetScrollHandler(); // The below code helps to display a new attached recyclerView on exact scrolled position. ((ColumnLayoutManager)viewHolder.recyclerView.GetLayoutManager()).ScrollToPositionWithOffset( scrollHandler.GetColumnPosition(), scrollHandler.GetColumnPositionOffset()); SelectionHandler selectionHandler = mTableView.GetSelectionHandler(); if (selectionHandler.IsAnyColumnSelected()) { AbstractViewHolder cellViewHolder = (AbstractViewHolder)viewHolder.recyclerView.FindViewHolderForAdapterPosition( selectionHandler.GetSelectedColumnPosition()); if (cellViewHolder != null) { // Control to ignore selection color if (!mTableView.IsIgnoreSelectionColors()) { cellViewHolder.SetBackgroundColor(mTableView.GetSelectedColor()); } cellViewHolder.SetSelected(AbstractViewHolder.SelectionState.Selected); } } else { if (selectionHandler.IsRowSelected(holder.AdapterPosition)) { selectionHandler.ChangeSelectionOfRecyclerView(viewHolder.recyclerView, AbstractViewHolder.SelectionState.Selected, mTableView.GetSelectedColor()); } } }