title: Loading items into a RecyclerView with stackFromEnd = true doesn't scroll to bottom
body: <p>I have a chat app and i'm trying to ensure that when the user opens the screen the items display from the bottom with the most recent right above the input area. I've used a custom view for the input area and both the recycler and the custom view are within a ConstraintLayout. </p>
  
  <p>My problem is that when I load items into the list, if the number of items is greater than the size of the recycler, it will not fully show the last item. When I make the input area visibility = Gone then the items display properly at the bottom. It's almost like the recyclers LinearLayoutManager thinks that the height of the Recycler is of the screen without the input field. I've manually printed out the size of the views and used layout inspector to ensure that the recycler is indeed drawn in the correct location (above the input and below the navigation bar).</p>
  
  <p>What could be causing such an issue? I should note that whenever you click on a Linkified text in a chat bubble that the list scrolls a small amount equal to the offset that's incorrect when you open the screen. Clearly something is not measuring right here and not sure where to begin.</p>
  
  <p>I should also note that if I try to add a post with smoothScroll it will go to the end of the list but then whenever a new item appears in the list from sending a message the items above the most recently added one seem to jump up a little with an unnecessary animation. It's like the last item in the list is in some special state?</p>
  
  <p>if you're curious this is my scrolling function:</p>
  
  <pre><code>private fun scrollToFirstItem(dueToKeyboard: Boolean = false) {
      val stackingFromEnd = (recyclerView.layoutManager as LinearLayoutManager).stackFromEnd
  
      if (stackingFromEnd) {
          val firstPosition = recyclerView.adapter?.itemCount?: 0 - 1
          if (dueToKeyboard ) {
              recyclerView.scrollBy(0, Integer.MAX_VALUE)
          } else {
              recyclerView.scrollToPosition(firstPosition)
          }
          recyclerView.post { recyclerView.smoothScrollToPosition(firstPosition) }
      } else {
          recyclerView.scrollToPosition(0)
      }
  }
  </code></pre>
  
  <p>And my xml for my fragment:</p>
  
  <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  &lt;include
          android:id="@+id/searchView"
          layout="@layout/compose_new_message_include"/&gt;
  
  &lt;com.airbnb.epoxy.EpoxyRecyclerView
          android:id="@+id/conversationEpoxyRV"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:scrollbars="vertical"
          app:layout_constraintTop_toBottomOf="@id/searchView"
          app:layout_constraintBottom_toTopOf="@id/composeView"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintLeft_toLeftOf="parent"
          tools:listitem="@layout/conversation_item_inbound"/&gt;
  
  &lt;include layout="@layout/conversation_pip_view"
   android:id="@+id/selectedMediaContainer"/&gt;
  
  &lt;****.ComposeView
          android:id="@+id/composeView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintBottom_toBottomOf="parent"/&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>Any help is appreciated, I'm so lost..</p>