title: Recyclerview with ListAdapter DiffCallback and Undo on swipe option
body: <p>Let's say that there is a simple scenario: </p>
  
  <ul>
  <li><code>user</code> table for storing user details </li>
  <li><code>user_images</code> to store in a <code>image_path</code> field the paths of images in the phone's storage.</li>
  </ul>
  
  <p>There is a list of users shown in a <code>RecyclerView</code> and the user can Swipe to delete a row. The adapter is a <code>ListAdapter</code> and the data comes from Room as being <code>LiveData</code></p>
  
  <p>Workflow I was thinking is like this:</p>
  
  <ol>
  <li>remove the swiped item from the adapter and update the recyclerview</li>
  <li>show a Snack with Undo option</li>
  <li>on Snack if user presses Undo, re-add the item in the <code>ListAdapter</code> and update the recyclerview. If the user does not press Undo and the Snack gets dismissed after timeout, delete the rows from <code>user</code>, <code>user_images</code> and also delete all the images from the storage related to <code>user_images</code> in <code>image_path</code></li>
  </ol>
  
  <p>...</p>
  
  <pre><code>override fun onSwiped(...){
    val deletedItem = listAdapter.currentList.get(index)
  
    //REMOVE FROM THE ADAPTER HERE
  
    val snack = Snackbar.make(...)
    snack.setAction(...){
        //RE-ADD TO ADAPTER HERE
    }
  
    snack.addCallback(...){
      override fun onDismissed(...){
         //do the actual deletes
      }
    }
  
  }
  </code></pre>
  
  <p>...</p>
  
  <p>The issue is using the ListAdapter. As you may know it uses DiffCallBack to manage the view updates and calling <code>adapter.submitList(list)</code> does not trigger any updates as it receives the same list. (<a href="https://stackoverflow.com/questions/49726385/listadapter-not-updating-item-in-reyclerview">ListAdapter not updating item in reyclerview</a>)
  So in order to be able to remove item, I would need to:</p>
  
  <ul>
  <li>get the adapter's <code>currentList</code> as <code>Mutable</code> updatebleList</li>
  <li>remove the item from the updatebleList</li>
  <li>re-submit the list to the adapter <code>adapter.submitList(updatebleList.toList())</code></li>
  <li>in case of Undo, re-add the item to the updatebleListand submit it again as a new list <code>adapter.submitList(updatebleList.toList())</code></li>
  </ul>
  
  <p>As you see, there are a lot of list re-creation in order to properly submit.
  Is there a better/simpler way to achieve this? </p>