title: How to inflate different layout in RecyclerView based on its position in onCreateViewHolder method
body: <p>I am trying to refactor my ListView to RecyclerView and I stuck in this situation.</p>
  
  <blockquote>
    <p>In my ListView Adapter i have something like this:</p>
  </blockquote>
  
  <pre><code>@Override
  public int getItemViewType(int position) {
      if (mDecommissionMode &amp;&amp; position == getCount() - 1)
          return 1;
      return 0;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
  
      if (getItemViewType(position) == 0)
          return getNormalView(position, convertView, parent);
      else
          return getManualDecommissionView(convertView, parent);
  
  }
  </code></pre>
  
  <p>I don't have an idea how can I apply this to my RecyclerView adapter because <strong>I don't have access to the position in onCreateViewHolder</strong> method, where the layout should be inflated.</p>
  
  <blockquote>
    <p>Here are the methods in my RecyclerView Adapter:</p>
  </blockquote>
  
  <pre><code>@Override
  public DevicesItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      DevicesRecyclerViewAdapter.DevicesItemViewHolder holder = new DevicesItemViewHolder(); //should pass some inflated view to ViewHolder instance
      holder.itemView.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              mOnClickListener.onClick(view);
          }
      });
      return holder;
  }
  
  
  @Override
  public void onBindViewHolder(DevicesItemViewHolder holder, int position) {
  
  
  }
  </code></pre>
  
  <p>Is there a way I can cope with it?</p>