title: How to consistently add alternating backgrounds to item views in RecyclerView
body: <p>Up until now I used the Adapter's <code>onBindViewHolder</code> to set an alternating background based on the item's Adapter-Position.</p>
  
  <pre><code>@Override
  public void onBindViewHolder(ViewHolder holder, int position) {
      holder.itemView.setBackgroundResource(position % 2 == 0 ?
              R.color.list_item_background_alternating : R.color.list_item_background);
      ...
  }
  </code></pre>
  
  <p>However, this is getting more an more complicated when doing more than just showing a list. 
  For example: When I remove an item and call <code>notifyItemRemoved(index);</code> the <code>RecyclerView</code> does a nice animation and the item view is gone. However, the view which replaces the removed one doesn't get bound again (for obvious &amp; good reasons) and therefore keeps it's old background. This leads to inconsistencies with the layout and looks ugly. When I call <code>notifyDataSetChanged();</code> the backgrounds are all correct, but I lose the animation.</p>
  
  <p>I have a similar problem when I'm using <code>SortedList</code> (with a <code>SortedListAdapterCallback</code>). Since the sorting seems to take place after the views are bound the backgrounds are in shambles. </p>
  
  <p>What would be a proper/consistent way to implement such behaviour?</p>