title: RecyclerView and SwipeRefreshLayout
body: <p>I'm using the new <code>RecyclerView-Layout</code> in a <code>SwipeRefreshLayout</code> and experienced a strange behaviour. When scrolling the list back to the top sometimes the view on the top gets cut in.</p>
  
  <p><img src="https://i.stack.imgur.com/z8guv.png" alt="List scrolled to the top"></p>
  
  <p>If i try to scroll to the top now - the Pull-To-Refresh triggers. </p>
  
  <p><img src="https://i.stack.imgur.com/ZKz34.png" alt="cutted row"></p>
  
  <p>If i try and remove the Swipe-Refresh-Layout around the Recycler-View the Problem is gone. And its reproducable on any Phone (not only L-Preview devices). </p>
  
  <pre><code> &lt;android.support.v4.widget.SwipeRefreshLayout
      android:id="@+id/contentView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:visibility="gone"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/hot_fragment_recycler"
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>That's my layout - the rows are built dynamically by the RecyclerViewAdapter (2 Viewtypes in this List). </p>
  
  <pre><code>public class HotRecyclerAdapter extends TikDaggerRecyclerAdapter&lt;GameRow&gt; {
  
  private static final int VIEWTYPE_GAME_TITLE = 0;
  private static final int VIEWTYPE_GAME_TEAM = 1;
  
  @Inject
  Picasso picasso;
  
  public HotRecyclerAdapter(Injector injector) {
      super(injector);
  }
  
  @Override
  public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position, int viewType) {
      switch (viewType) {
          case VIEWTYPE_GAME_TITLE: {
              TitleGameRowViewHolder holder = (TitleGameRowViewHolder) viewHolder;
              holder.bindGameRow(picasso, getItem(position));
              break;
          }
          case VIEWTYPE_GAME_TEAM: {
              TeamGameRowViewHolder holder = (TeamGameRowViewHolder) viewHolder;
              holder.bindGameRow(picasso, getItem(position));
              break;
          }
      }
  }
  
  @Override
  public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
      switch (viewType) {
          case VIEWTYPE_GAME_TITLE: {
              View view = inflater.inflate(R.layout.game_row_title, viewGroup, false);
              return new TitleGameRowViewHolder(view);
          }
          case VIEWTYPE_GAME_TEAM: {
              View view = inflater.inflate(R.layout.game_row_team, viewGroup, false);
              return new TeamGameRowViewHolder(view);
          }
      }
      return null;
  }
  
  @Override
  public int getItemViewType(int position) {
      GameRow row = getItem(position);
      if (row.isTeamGameRow()) {
          return VIEWTYPE_GAME_TEAM;
      }
      return VIEWTYPE_GAME_TITLE;
  }
  </code></pre>
  
  <p>Here's the Adapter. </p>
  
  <pre><code>   hotAdapter = new HotRecyclerAdapter(this);
  
      recyclerView.setHasFixedSize(false);
      recyclerView.setAdapter(hotAdapter);
      recyclerView.setItemAnimator(new DefaultItemAnimator());
      recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  
      contentView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
              loadData();
          }
      });
  
      TypedArray colorSheme = getResources().obtainTypedArray(R.array.main_refresh_sheme);
      contentView.setColorSchemeResources(colorSheme.getResourceId(0, -1), colorSheme.getResourceId(1, -1), colorSheme.getResourceId(2, -1), colorSheme.getResourceId(3, -1));
  </code></pre>
  
  <p>And the code of the <code>Fragment</code> containing the <code>Recycler</code> and the <code>SwipeRefreshLayout</code>. </p>
  
  <p>If anyone else has experienced this behaviour and solved it or at least found the reason for it?</p>