public static BaseViewHolder CreateViewHolder(Context context, ViewGroup parent, int layoutId)
        {
            View           itemView = LayoutInflater.From(context).Inflate(layoutId, parent, false);
            BaseViewHolder holder   = new BaseViewHolder(itemView);

            return(holder);
        }
Exemple #2
0
        private RecyclerView.ViewHolder GetLoadingView(ViewGroup parent)
        {
            View view   = GetItemView(loadMoreView.getLayoutId(), parent);
            var  holder = new BaseViewHolder(parent.Context, view);

            holder.ItemView.SetOnClickListener(this);
            return(holder);
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            this.layoutInflater = LayoutInflater.From(parent.Context);
            ViewHolder viewHolder = null;

            if (viewType == ITEM_TYPE_EMPTY)
            {
                if (emptyView != null)
                {
                    viewHolder = BaseViewHolder.CreateViewHolder(parent.Context, emptyView);
                }
                else
                {
                    viewHolder = BaseViewHolder.CreateViewHolder(parent.Context, parent, emptyLayoutId);
                }
            }
            if (viewType == ITEM_TYPE_DEFAULT)
            {
                var itemView = GetItemView(itemLayoutId, parent);
                viewHolder = new BaseViewHolder(itemView);
            }
            return(viewHolder);
        }
        public static BaseViewHolder CreateViewHolder(Context context, View itemView)
        {
            BaseViewHolder holder = new BaseViewHolder(itemView);

            return(holder);
        }