I've got a simple layout:
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/abLayoutDriver"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/BrightYellowCrayola">
<androidx.appcompat.widget.Toolbar
android:id="@+id/tbDriver"
app:navigationIcon="@drawable/baseline_menu_24"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"
>
<androidx.appcompat.widget.SearchView
android:id="@+id/svDriver"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:defaultQueryHint="@string/search_drivers"
app:iconifiedByDefault="false"
app:searchIcon="@null"
app:queryBackground="@android:color/transparent"
app:submitBackground="@android:color/transparent"
android:imeOptions="flagNoExtractUi"
/>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvListDriver"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/zero_margin_when_normal"
android:paddingEnd="@dimen/zero_margin_when_normal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_toEndOf="@id/abLayoutDriver"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabAddDriver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/add_driver"
android:minHeight="48dp"
android:src="@drawable/baseline_person_add_24"
app:backgroundTint="@color/BrightYellowCrayola" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
The issue is that on start, the first listview is automatically covered by the toolbar which I dont wan't it to be:
The expected view should look like this:
Basically I want the first item to be below the toolbar without having to scroll down first, how can I accomplish this?