public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            Debug.WriteLine("On create view holder");
            Debug.WriteLine("View type => " + viewType);
            Debug.WriteLine("Item template selector => " + ItemTemplateId);
            Debug.Write("Selector layout id => " + ItemTemplateSelector.GetItemLayoutId(viewType));
            base.OnCreateViewHolder(parent, viewType);
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var view = InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new SkillViewHolder(view, itemBindingContext));
        }
Beispiel #2
0
        protected virtual View InflateViewForHolder(ViewGroup parent, int viewType, IMvxAndroidBindingContext bindingContext)
        {
            int layoutId;

            if (FlatGroupTemplateSelector == null)
            {
                layoutId = viewType == _headerLayout
                   ? _headerLayout
                   :
                           (
                    viewType == _footerLayout
                       ? _footerLayout
                       : ItemTemplateSelector.GetItemLayoutId(viewType)
                           );
            }
            else
            {
                layoutId = FlatGroupTemplateSelector.GetItemLayoutId(viewType);
            }

            return(bindingContext.BindingInflate(layoutId, parent, false));
        }