Esempio n. 1
0
        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 ListItemTaskOrEventView(parent);
                unassignedView.Click += UnassignedView_Click;
                return(new GenericRecyclerViewHolder(unassignedView));

            default:
                return(base.OnCreateViewHolder(parent, viewType));
            }
        }
Esempio n. 2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
#if DEBUG
            try
            {
#endif
            if (viewType == 0)
            {
                var view = new ListItemTaskOrEventView(parent);

                view.Click += ListItemTaskOrEventView_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 CreateViewHolderForTaskOrEvent(ViewGroup parent)
        {
            var view = new ListItemTaskOrEventView(parent);

            view.Click += ListItemTaskOrEventView_Click;

            return(new GenericRecyclerViewHolder(view));
        }