title: showing a progress bar with android paging library
body: <p>I'm using paging library and room, making my room db as the single layer of truth of my app. when fetching is done from the server using retrofit, i save the result locally in the db then i get the data from the db using paging library. I'm using <a href="https://developer.android.com/reference/android/arch/paging/PagedList.BoundaryCallback" rel="noreferrer">BoundaryCallback </a>.</p>
  
  <pre><code>@Override
      public void onZeroItemsLoaded() {
          requestAndSaveData();
      }
      @Override
      public void onItemAtEndLoaded(@NonNull Photo itemAtEnd) {
          requestAndSaveData();
  }
  </code></pre>
  
  <hr>
  
  <pre><code> private void requestAndSaveData() {
          if (isRequestInProgress) return;
          isRequestInProgress = true;
          apiInterface.getPhotos(lastRequestPage, NETWORK_PAGE_SIZE).enqueue(new Callback&lt;PhotoList&gt;() {
              @Override
              public void onResponse(Call&lt;PhotoList&gt; call, Response&lt;PhotoList&gt; response) {
                  if (response.isSuccessful()) {
                      cache.insertPhotos(response.body().getHits()); //todo only save 20 - 40 items
                      lastRequestPage++;
                      isRequestInProgress = false;
                      Log.i("deb", "number from boundary: " + response.body().getHits().size());
                  }
  }
  </code></pre>
  
  <p>When there is no item in the db or the user scroll to the last item i call <code>requestAndSaveData()</code> method that fetch the data from the server and save it into the db. </p>
  
  <p>My question is how to show a progress bar at the bottom of the list while loading the next page from the server and saving it to the db as it may take a long time?</p>