Ejemplo n.º 1
0
 public override int GetItemViewType(int position)
 {
     if (IsHeaderViewPos(position))
     {
         return(mHeaderViews.KeyAt(position));
     }
     else
     {
         if (IsFooterViewPos(position))
         {
             return(mFootViews.KeyAt(position - GetHeadersCount() - GetRealItemCount()));
         }
     }
     return(mInnerAdapter.GetItemViewType(position - GetHeadersCount()));
 }
        public virtual int GetItemViewType(T item, int position)
        {
            int delegatesCount = delegates.Size();

            for (int i = delegatesCount - 1; i >= 0; i--)
            {
                Com.Zhy.Adapter.Recyclerview.Base.ItemViewDelegate <T> delegate_ = delegates.ValueAt
                                                                                       (i);
                if (delegate_.IsForViewType(item, position))
                {
                    return(delegates.KeyAt(i));
                }
            }
            throw new System.ArgumentException("No ItemViewDelegate added that matches position="
                                               + position + " in data source");
        }