title: Show Progress Bar when Endless scroll is loading more data
body: <p>Okay so i have implemented Endless Scroll in my app using this <a href="https://github.com/codepath/android_guides/wiki/Endless-Scrolling-with-AdapterViews-and-RecyclerView" rel="nofollow noreferrer">famous android endless scroll library</a>. I want to show the progress bar when the app gets to the bottom and loading more data and then hide it when we get data. I'm using Volley to get the data.</p>
  
  <p><strong>This is my onScroll Listener</strong></p>
  
  <pre><code>scrollListener = new EndlessRecyclerViewScrollListener(manager) {
          @Override
          public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {
  
              loadMore(page);
              ++page;
          }
      };
  </code></pre>
  
  <p><strong>This is my loadMore function</strong></p>
  
  <pre><code>public void loadMore(int page) {
  
      String url = url + page;
      StringRequest stringRequest = new StringRequest(url, new Response.Listener&lt;String&gt;() {
          @Override
          public void onResponse(String response) {
              ArrayList&lt;Deal&gt; deals = new JsonConverter&lt;Deal&gt;().toArrayList(response, Deal.class);
              adapter.addAll(deals);
  
  
  
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.d(TAG, error.toString());
              Toast.makeText(getApplicationContext(), "Bad Network Connection. Please Try Again", Toast.LENGTH_LONG).show();
              stopAnim();
  
          }
      }
      );
  
      int socketTimeout = 30000; // 30 seconds. You can change it
      RetryPolicy policy = new DefaultRetryPolicy(socketTimeout,
              DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
              DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
  
      stringRequest.setRetryPolicy(policy);
      MySingleton.getInstance(getApplicationContext()).addToRequestQueue(stringRequest);
      mSwipeRefresh.setRefreshing(false);
  
  
  }
  </code></pre>
  
  <p>So now what i want to do now is display the progress bar when more data is being loaded and hide it when its done loading.</p>
  
  <p>I've tried this <a href="https://github.com/pwittchen/InfiniteScroll/blob/master/app/src/main/java/com/github/pwittchen/infinitescroll/app/MainActivity.java" rel="nofollow noreferrer">https://github.com/pwittchen/InfiniteScroll/blob/master/app/src/main/java/com/github/pwittchen/infinitescroll/app/MainActivity.java</a> but didn't work.</p>
  
  <p>I've also tried this <a href="https://gist.github.com/nesquena/a988aac278cff59a9a69" rel="nofollow noreferrer">https://gist.github.com/nesquena/a988aac278cff59a9a69</a>
  but wasn't getting it.</p>