I am trying to fix this issue where my recyclerview is overlapped by bottomappbar. Here is my layout code .
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/notes_container_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:padding="8dp"
android:text="@string/myTasksHeader"
android:textColor="@color/appBarTextColor"
android:textSize="40dp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:padding="16dp"
android:scrollbars="none"
tools:listitem="@layout/note_list_item" />
</ScrollView>
</LinearLayout>
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:backgroundTint="@color/colorPrimary"
app:hideOnScroll="false"
app:menu="@menu/appbar_menu"
app:navigationIcon="@drawable/ic_menu" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_note_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium_margin"
android:backgroundTint="@color/colorPrimary"
app:layout_anchor="@id/bottomAppBar"
app:srcCompat="@drawable/ic_add_black_24dp"
tools:ignore="VectorDrawableCompat" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
when I fill my list I cant reach my last item in the recycler view. I tried adding margin but it did not work.

Two ways to achieve this
Hide BottomAppBar layout while scrolling ..
Add following attribute inside BottomAppBar
app:fabAlignmentMode="center"
app:fabCradleMargin="10dp"
app:fabCradleRoundedCornerRadius="10dp"
app:hideOnScroll="true"
If you do not want to hide BottomAppBar then add margin from bottom
in RecyclerView
android:layout_marginBottom="?actionBarSize"
The problem with using margin is that the RecyclerView won't show through the FAB. A better solution than using margin would be to add extra space at the bottom of the RecyclerView using padding.
android:clipToPadding="false"
android:paddingBottom="?actionBarSize"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With