title: Avoid SwipeRefresh while fastScrolling in android
body: <p>I have a <strong><code>ListView</code></strong> having <code>fastScroll</code> always enabled and <code>SwipeRefresh</code> implementation. When i swipe the list downward, it refreshes the list. My problem is <code>fastScroll</code>. If the list has its first item visible or say at its initial top, then if scroll the <code>fastScrollThumb</code> downward, it does the <strong><code>Swipe</code></strong> effect not the scroll down. Is there anyway/solution that if i press the <code>fastScrollThumb</code> , then it should not do <code>Swipe</code> refresh effect rather it should scroll down as it natural behavior. </p>
  
  <p><img src="https://i.stack.imgur.com/m97Rs.jpg" alt="enter image description here"></p>
  
  <p><strong>EDITED</strong>
  My <code>XML Layout</code> is as follow:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;android.support.v4.widget.SwipeRefreshLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/swipe_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/white" &gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;RelativeLayout
              android:id="@+id/buttons_layout"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="10dp"&gt; 
  
              &lt;ImageView
                  android:id="@+id/SubmitButton"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@drawable/neoo_tab_selector" /&gt;
  
          &lt;/RelativeLayout&gt;
  
  
          &lt;ListView
              android:id="@id/android:list"
              style="@style/NeeoContactListView"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_below="@+id/buttons_layout"
              android:layout_marginTop="10dp" /&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>My <strong><code>Logic for onScroll</code></strong> for enabling/disabling the <strong><code>SwipeRefresh</code></strong> is :</p>
  
  <pre><code>    getListView().setOnScrollListener(new OnScrollListener() {
  
      @Override
      public void onScrollStateChanged(AbsListView view, int scrollState) {
      }
  
      @Override
      public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
          boolean enable = false;
          if(getListView() != null &amp;&amp; getListView().getChildCount() &gt; 0){
              // check if the first item of the list is visible
              boolean firstItemVisible = getListView().getFirstVisiblePosition() == 0;
              // check if the top of the first item is visible
              boolean topOfFirstItemVisible = getListView().getChildAt(0).getTop() == 0;
              // enabling or disabling the refresh layout
              enable = firstItemVisible &amp;&amp; topOfFirstItemVisible;
          }
          if(enable){
              enableSwipe();
  
          }else{
              disableSwipe();
  
          }
      }
  });
  </code></pre>