title: SwipeRefreshLayout inside ViewPager
body: <p>I have an activity that consists of a Toolbar and a view pager. Its layout is as follows:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/pager"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingTop="112dp"
      android:layout_gravity="bottom"
      tools:context=".Rhino68PanelActivity" /&gt;
  
  &lt;LinearLayout
      android:id="@+id/toolbarContainer"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"&gt;
  
      &lt;include
          android:id="@+id/app_bar"
          layout="@layout/app_bar" /&gt;
  
      &lt;include
          android:id="@+id/tap_strip"
          layout="@layout/tab_strip" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>I then load two fragments into the view pager. Each fragment contains its own <code>SwipeRefreshLayout</code>. I will show one fragments layout:</p>
  
  <pre><code>&lt;android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/swipe_refresh_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:weightSum="12"
      tools:context=".Rhino68PanelActivity$DummySectionFragment"&gt;
      ...        
    &lt;android.support.v7.widget.RecyclerView
      android:id="@+id/recyclerView_panel_status"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:clipToPadding="false" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now when I run the activity it seems to work. However I have noticed that is I slide horizontally  (ie to go to the next tab). It triggers the <code>swipeRefreshLayout</code> OnRefreshListener</p>
  
  <pre><code>     mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
              @Override
              public void onRefresh() {
                  mSwipeRefreshLayout.setRefreshing(true);
                  DoUpdate();
              }
          });
  </code></pre>
  
  <p>I am also experiencing odd visual behavior when I do try and do a refresh. The loading sign (spinning circle) often doesn't show, and it sometimes shows but stays small. I'm not sure if this is also a cause of the two views conflicting with one another.</p>
  
  <p>Is there some way that I can fix this issue. I'm not to sure how. Maybe by limiting the SwipeRefreshLayout to only listen for vertical swipes?</p>
  
  <p>Any suggestions will be greatly appreciated.</p>