title: Android Paging Library - Data + Network with multiple sorting types
body: <p>I recently saw that google has a great library for paginating data.</p>
  
  <p>In this Google IO:</p>
  
  <p><a href="https://www.youtube.com/watch?v=BE5bsyGGLf4&amp;t=17s" rel="nofollow noreferrer">Android Jetpack: manage infinite lists with RecyclerView and Paging (Google I/O '18)</a></p>
  
  <p>They explained how to make <code>Data + Network DataSource</code> and grab data from database as <code>Single Source of Truth</code> and when the database is out of data it request for more data from the network with <code>BoundaryCallback</code>.</p>
  
  <p>So assume that I have a list of Movies on the server. And client (Android user) can sort them by popularity, title, date_release and ...</p>
  
  <p>So in the first time if the user sort movies by titles everything will work great because there is no data in database and data will be requested from the server to sort them by title and send them back.
  But what if after that user tries to sort them by popularity for example? Because of the availability of chunk of movies in database (for example 50 movies), it will sort this small amount of movies by popularity and then tries to grab data from server and this is not a good experience.</p>
  
  <p>I cant make table for every sort type because it is not a good practice. So how can I overcome to this problem?</p>
  
  <p>Thanks very much</p>