public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case GRADE_ITEM_TYPE: var gradeView = new ListItemGradeView(parent); gradeView.Click += GradeView_Click; return(new GenericRecyclerViewHolder(gradeView)); case TOP_HEADER_ITEM_TYPE: var header = new ClassGradesTopHeaderView(parent, hideWhatIfModeButton: false); header.ButtonEditGradeOptionsClick += Header_ButtonEditGradeOptionsClick; header.ButtonWhatIfModeClick += Header_ButtonWhatIfModeClick; return(new GenericRecyclerViewHolder(header)); case SECTION_HEADER_ITEM_TYPE: return(new GenericRecyclerViewHolder(new ListItemHeaderWeightCategoryView(parent))); case UNASSIGNED_ITEMS_HEADER_TYPE: return(new GenericRecyclerViewHolder(new InflatedViewWithBinding(Resource.Layout.ListItemUnassignedItemsHeader, parent))); case UNASSIGNED_ITEM_TYPE: var unassignedView = new ListItemHomeworkView(parent); unassignedView.Click += UnassignedView_Click; return(new GenericRecyclerViewHolder(unassignedView)); default: return(base.OnCreateViewHolder(parent, viewType)); } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { #if DEBUG try { #endif if (viewType == 0) { var view = new ListItemHomeworkView(parent); view.Click += ListItemHomeworkView_Click; return(new GenericRecyclerViewHolder(view)); } return(base.OnCreateViewHolder(parent, viewType)); #if DEBUG } catch (Exception ex) { System.Diagnostics.Debugger.Break(); throw ex; } #endif }
private RecyclerView.ViewHolder CreateViewHolderForHomework(ViewGroup parent) { var view = new ListItemHomeworkView(parent); view.Click += ListItemHomeworkView_Click; return(new GenericRecyclerViewHolder(view)); }