My reclerview's last row is being covered by my bottom app bar.
My code is as follows:
activity_home.xml
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@id/Container_fromHomeActivity_BottomAppBarFragments"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="@bool/Navigation_NavigationHost_Default"
app:navGraph="@navigation/bottomappbar_navigation"/>
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@id/BottomAppBar_fromHomeActivity_Main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:fabAlignmentMode="center"
app:navigationIcon="@drawable/ic_menu_dark"
app:menu="@menu/menu_bottomappbar_main"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@id/FAB_fromHomeActivity_BottomAppBarAttached"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_dark"
android:backgroundTint="@color/colorAccent"
app:layout_anchor="@id/BottomAppBar_fromHomeActivity_Main"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
My reclerview is in a fragment from my home activity:
fragment.xml
<layout
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">
<androidx.constraintlayout.widget.ConstraintLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/todoList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="8dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
However, the last row is only half visible as such:
From the material guidelines, the Bottom App Bar and FAB SHOULD be inside a coordinator layout for them to work together. So how am i supposed to lift my recyclerview above the bottom app bar so that the last row is visible too?
I don't want to add padding or margin at the end because it doesn't seem to be good coding...
Please help!