title: RecyclerView with GridLayoutManager insert item wrong position
body: <p>I'm seeing odd behavior in a <code>RecyclerView</code> using a <code>GridLayoutManager</code> with 2 spans.</p>
  
  <p>I'm trying to get two columns of items:</p>
  
  <pre><code>0 1
  2 3
  4 5
  6 7
  </code></pre>
  
  <p>... and so on</p>
  
  <p>To achieve this, I'm creating a <code>GridLayoutManager</code> like so:</p>
  
  <pre><code>    GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2);
      gridLayoutManager.setOrientation(GridLayoutManager.VERTICAL);
  </code></pre>
  
  <p>Initially this behaves perfectly.  My items appear in the order I want them to.</p>
  
  <p>However, I also need to be able to remove items from the list, and then undo the removal if the user acts quickly enough.</p>
  
  <p>To remove items and then allow undo/insertion of the item back in, I have the following logic executed when a user hits a "remove" button in the <code>RecyclerView</code> items.</p>
  
  <pre><code>    final Item = mItems.getItem(position);
      mItems.remove(position);
      notifyItemRemoved(position);
  
      // Give the user a chance to undo the removal
      Snackbar.make(getView(),
                    "Item Removed", Snackbar.LENGTH_LONG)
              .setAction(R.string.item_removed_snackbar_undo, new View.OnClickListener()
              {
                  @Override
                  public void onClick(View view)
                  {
                      mItems.add(position, item);
                      notifyItemInserted(position);
                  }
              }).show();
  </code></pre>
  
  <p><code>mItems</code> represents the list of items in my adapter.  <code>position</code> represents the adapter position of the item that had the remove button clicked.  </p>
  
  <p>Removing items behaves perfectly.  I am able to remove items, and items animate to fill in the empty spaces.  However, when I try to undo the deletion and add the item back, the recycler view gets messed and empty spaces are inserted.  For example, if I had the following items, and I removed item 2, then undid the removal this is what would happen:</p>
  
  <pre><code>0 1
  2 3
  </code></pre>
  
  <p>remove 2</p>
  
  <pre><code>0 1
  3 
  </code></pre>
  
  <p>add 2 back</p>
  
  <pre><code>0 1
  2
  3
  </code></pre>
  
  <p>At this point, an "empty" view exists where 3 should be placed (second row, second column).  If I query the size of the adapter I still get 4 items, but somehow the items are spread out to take 5 positions total.  Touching the empty space does nothing, but if I reorient/config change the layout goes back to </p>
  
  <pre><code>0 1
  2 3
  </code></pre>
  
  <p>as expected.</p>
  
  <p>Am I doing something wrong?</p>
  
  <p>Thanks,
  Zach</p>