title: What is the proper way to scroll to end of recyclerview in paging 3
body: <p>There is a situation where I have to scroll the recyclerview to last position. The problem starts where I am using Paging 3. I don't know what is the proper way to do it every time I submit data to adapter. by the way I have to say that I do not submit data once, but for example every time user submits a new comment to backend I have to get the new list from server and submit it.<br>
  This is what I tried. that's how I observe data:</p>
  <pre><code>private fun observeComments() {
          exploreViewModel.commentsLiveData.observe(viewLifecycleOwner) { comments -&gt;
              commentsAdapter.submitData(viewLifecycleOwner.lifecycle, comments)
          }
      }
  </code></pre>
  <p>And this is how I tried to scroll the recyclreview to last item:</p>
  <pre><code>commentsAdapter.addLoadStateListener { loadStates -&gt;
              if(loadStates.refresh.endOfPaginationReached){
                  if(commentsAdapter.itemCount&gt;1)
                      binding.rvComments.smoothScrollToPosition(commentsAdapter.itemCount-1)
              }
          }
  </code></pre>
  <p>I also set <code>app:stackFromEnd=&quot;true&quot;</code> to recyclerview but this is not useful. whenever I submit a new comment and get the list, recyclerview scrolls to the middle, I thinks it scrolls to the first pages end. but I want it to be scrolled to the end of the list.<br>
  Any help or suggestion would be appreciated.</p>