title: in kotlin why is my recyclerview not scrolling
body: <p>I am new to recycler views and beginning with Room databases. I am working on this app that lets the user enter records into Room database. The user enters the info and it gets stored. The top part of the screen is the data entry and the bottom is the recycler view where the records are displayed. Everything is fine until there are enough records to fill the available space. Then the new records just disappear below the screen. There is animation when the user tries to scroll, but the items don't move. I tried to make the items bigger by adding a padding, and strangely enough there is scrolling now, but just to the same item that displayed before.</p>
  <p>This is the main.xml</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
                                                     xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
                                                     xmlns:tools=&quot;http://schemas.android.com/tools&quot;
                                                     android:layout_width=&quot;match_parent&quot;
                                                     android:layout_height=&quot;match_parent&quot;
                                                     android:padding=&quot;10dp&quot;
                                                     tools:context=&quot;.MainActivity&quot;&gt;
  
      &lt;TextView
              android:id=&quot;@+id/tvNameLabel&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:text=&quot;Name&quot;
              app:layout_constraintBottom_toBottomOf=&quot;@id/etName&quot;
              app:layout_constraintTop_toTopOf=&quot;@+id/etName&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintEnd_toStartOf=&quot;@+id/etName&quot;
  
      /&gt;
  
      &lt;EditText
              android:id=&quot;@+id/etName&quot;
              android:layout_width=&quot;0dp&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:hint=&quot;Enter Name&quot;
              android:layout_marginStart=&quot;16dp&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;
              app:layout_constraintStart_toEndOf=&quot;@+id/tvNameLabel&quot;/&gt;
  
      &lt;TextView
              android:id=&quot;@+id/tvEmailLabel&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:text=&quot;Email Id&quot;
              app:layout_constraintBottom_toBottomOf=&quot;@+id/etMailId&quot;
              app:layout_constraintEnd_toStartOf=&quot;@+id/etMailId&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toBottomOf=&quot;@id/etName&quot;/&gt;
  
      &lt;EditText
              android:id=&quot;@+id/etMailId&quot;
              android:layout_width=&quot;0dp&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:hint=&quot;Enter Email Id&quot;
              android:layout_marginStart=&quot;8dp&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintStart_toEndOf=&quot;@+id/tvEmailLabel&quot;
              app:layout_constraintTop_toBottomOf=&quot;@+id/etName&quot;/&gt;
  
      &lt;Button
              android:id=&quot;@+id/btnAdd&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_marginTop=&quot;20dp&quot;
              android:layout_marginBottom=&quot;20dp&quot;
              android:layout_height=&quot;80dp&quot;
              android:text=&quot;ADD RECORD&quot;
              app:layout_constraintTop_toBottomOf=&quot;@+id/etMailId&quot;/&gt;
  
      &lt;TextView
              android:id=&quot;@+id/tvName&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_marginStart=&quot;10dp&quot;
              android:gravity=&quot;center&quot;
              android:text=&quot;All The Inserted Records&quot;
              android:textColor=&quot;@color/black&quot;
              android:textSize=&quot;18sp&quot;
              android:textStyle=&quot;bold&quot;
              app:layout_constraintTop_toBottomOf=&quot;@+id/btnAdd&quot;/&gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
              android:id=&quot;@+id/rvItemsList&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              app:layout_constraintTop_toBottomOf=&quot;@id/tvName&quot;
              android:visibility=&quot;visible&quot;
              tools:visibility=&quot;visible&quot;
      /&gt;
  
      &lt;TextView
              android:id=&quot;@+id/tvNoRecordsAvailable&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintTop_toBottomOf=&quot;@+id/btnAdd&quot;
              android:gravity=&quot;center&quot;
              android:textSize=&quot;18sp&quot;
              android:textColor=&quot;#997b66&quot;
              android:text=&quot;There Are No records&quot;
              tools:visibility=&quot;visible&quot;/&gt;
  
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p>and this is the items xml:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
                android:id=&quot;@+id/llMain&quot;
                android:layout_width=&quot;match_parent&quot;
                android:layout_height=&quot;wrap_content&quot;
                android:orientation=&quot;horizontal&quot;
                android:gravity=&quot;center_vertical&quot;
                android:padding=&quot;20dp&quot;&gt;
  
      &lt;TextView
              android:id=&quot;@+id/tvName&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:textColor=&quot;@color/black&quot;
              android:textSize=&quot;16sp&quot;
              android:text=&quot;Name&quot;/&gt;
  
      &lt;TextView
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_marginStart=&quot;5dp&quot;
              android:layout_marginEnd=&quot;5dp&quot;
              android:textSize=&quot;18sp&quot;
              android:textStyle=&quot;bold&quot;
              android:text=&quot;:&quot;/&gt;
  
      &lt;TextView
              android:id=&quot;@+id/tvEmail&quot;
              android:layout_width=&quot;0dp&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_weight=&quot;1&quot;
              android:textColor=&quot;@color/black&quot;
              android:textSize=&quot;16sp&quot;
              android:text=&quot;Email&quot;/&gt;
  
      &lt;ImageView
              android:id=&quot;@+id/ivEdit&quot;
              android:layout_width=&quot;50dp&quot;
              android:layout_height=&quot;50dp&quot;
              android:contentDescription=&quot;image&quot;
              android:foreground=&quot;?attr/selectableItemBackgroundBorderless&quot;
              android:scaleType=&quot;center&quot;
              android:src=&quot;@drawable/ic_action_edit&quot;/&gt;
  
      &lt;ImageView
              android:id=&quot;@+id/ivDelete&quot;
              android:layout_width=&quot;50dp&quot;
              android:layout_height=&quot;50dp&quot;
              android:contentDescription=&quot;image&quot;
              android:foreground=&quot;?attr/selectableItemBackgroundBorderless&quot;
              android:scaleType=&quot;center&quot;
              android:src=&quot;@drawable/ic_action_delete&quot;/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>I don't know if any of the other files could be the culprits; but I can add them.</p>
  <p>Any help would be greatly appreciated.</p>