In my project i added the navhost
fragment and BottomNavigationView
to the my activity_main and everything seems fine when navigation but when i click the toolbar options i navigated to the another page but i still see the bottom navigation view, how can i not see the bottom navigation view? I added the navigation xml to navigate all the pages and created the bottom navigation menu on my resource file. The only problem is when i navigate to another page inside the bottom navigation pages i still see the bottom navigation view.
<androidx.appcompat.widget.Toolbar
android:id="@+id/app_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/app_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/text_some"
android:fontFamily="@font/lobster_two"
android:text="@string/text_some"
android:textColor="@color/colorSecondary"
android:textSize="24sp" />
</androidx.appcompat.widget.Toolbar>
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/app_toolbar"
app:layout_constraintVertical_bias="0.0"
app:navGraph="@navigation/bottom_navigation_graph" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_navigation_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:showAsAction="always|withText"
app:itemIconSize="22dp"
app:itemIconTint="@drawable/bottom_nav_color"
app:itemTextColor="@drawable/bottom_nav_color"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/bottom_nav_menu" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/circle_view_image"
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_marginBottom="25dp"
android:elevation="99dp"
android:src="@drawable/image"
app:layout_constraintBottom_toBottomOf="@+id/bottom_nav"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>