title: Recycler view inside Coordinator layout
body: <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.coordinatorlayout.widget.CoordinatorLayout 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:orientation=&quot;vertical&quot;
      android:id=&quot;@+id/rootLayout_survey_ques&quot;
      tools:context=&quot;.survey.SurveyQuesActivity&quot;&gt;
  
      &lt;include layout=&quot;@layout/toolbar&quot;
          android:id=&quot;@+id/survey_ques_toolbar&quot;/&gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:id=&quot;@+id/survey_ques_recycler_view&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_below=&quot;@id/survey_ques_toolbar&quot;
          android:layout_marginTop=&quot;2dp&quot; /&gt;
  
      &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_gravity=&quot;bottom|end&quot;
          android:layout_margin=&quot;16dp&quot;
          android:elevation=&quot;10dp&quot;
          android:id=&quot;@+id/fab_submit&quot;
          android:src=&quot;@drawable/ic_submit&quot; /&gt;
  &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/slKGA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/slKGA.png" alt="" /></a></p>
  <p>when fab is clicked, the <code>snack bar</code> appears, for that, I have to use the coordinator layout to move the fab horizontally above the snack bar. But now the first few items of <code>recyclerview</code> is not visible. It only starts with item3. Can someone please help in solving this and what changes are to be made?</p>
  <p><a href="https://i.stack.imgur.com/4aImc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4aImc.png" alt="" /></a></p>
  <p>Thanks in advance!!</p>