I have a bottom bar which consists of 4 fragments. Fragment A, B, C, and D. I wanted navigation drawer in fragment A, so I implemented successfully. But the problem is whenever I am opening the drawer, the bottom bar comes in front as it is in the activity layout not in that fragment. How to put the bottom bar behind the navigation drawer when it is open?
frag_A
<?xml version="1.0" encoding="UTF-8"?>
<androidx.drawerlayout.widget.DrawerLayout
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"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
android:layout_gravity="start"
app:headerLayout="@layout/navigation_header"
/>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/toolbar" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="66dp"
android:background="@color/colorPrimaryDark"
android:backgroundTint="@color/colorPrimaryDark"
android:scaleType="center"
android:src="@drawable/post"
app:elevation="6dp"
app:maxImageSize="25dp"
app:pressedTranslationZ="12dp" />
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/appbar"
android:background="@color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/content_main">
</include>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.drawerlayout.widget.DrawerLayout>
activity_main
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
style="@style/BottomNavigationView"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_gravity="bottom"
android:background="@drawable/rectanle_bg_bottom"
android:foreground="?attr/selectableItemBackground"
android:theme="@style/BottomNavigationTheme"
app:itemBackground="@color/white"
app:itemIconSize="17dp"
app:itemIconTint="@drawable/bottom_navigation_selector"
app:itemTextColor="@color/color_selector"
app:labelVisibilityMode="labeled"
/>