title: java.lang.ArrayIndexOutOfBoundsException: length=27; index=-1
body: <p>I'm getting this error when i'm implementing footer within recycler view.</p>
  
  <p>This is how i have done it. I was using two types for showing different views in list, but something is not set well in method <code>getItemCount()</code> or maybe when i'm getting position of clicked item model in list.</p>
  
  <p>This is what i have so far:</p>
  
  <pre><code>private final int VIEW_TYPE_ITEM = 0;
  private final int VIEW_TYPE_FOOTER = 1;
  
  @Override
  public int getItemCount() {
      return mUsers == null ? 0 : mUsers.size() + 1;
  }
  
  @Override
  public int getItemViewType(int position) {
      if (isFooterPosition(position)) {
          return VIEW_TYPE_FOOTER;
      }
      return VIEW_TYPE_ITEM;
  }
  
  private boolean isFooterPosition(int position) {
      return position == mUsers.size() + 1;
  }
  
  private User getUser (int position) {
      return mUsers.get(position - 1); // Here i'm getting an error mentioned in title
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <pre><code>if (holder instanceof UserHolder) {
          final User user = getUser(position);
          UserHolder userViewHolder = (UserHolder) holder;
  
          userViewHolder.tvUserName.setText(user.getName());
          userViewHolder.mView.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  mOnItemClickListener.onItemClick(v, position);
              }
          });
      } else if (holder instanceof FooterViewHolder) {
          FooterViewHolder footerViewHolder = (FooterViewHolder) holder;
          Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), "Lato-Thin.ttf");
          footerViewHolder.mButton.setTypeface(typeface);
      }
  </code></pre>
  
  <p>I have some items for normal holder view in list and one item for footer view.</p>