PROBLEM
I want my screen like this when soft navigation key open:
But when I open my soft navigation key, it overlaps BottomNavigationView:
CODE
I use MainActivity: 4 fragment and BottomNavigationView
AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity
android:name=".AddActivity"
android:exported="true" />
<activity
android:name=".SplashActivity"
android:noHistory="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"></activity>
</application>
layout activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".MainActivity">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="676dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/white"
app:menu="@menu/bottom_menu"
app:itemIconTint="@drawable/drawer_item_color"
app:itemTextColor="@drawable/drawer_item_color"/>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragmentContainerView"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="674dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/my_nav" />
</androidx.constraintlayout.widget.ConstraintLayout>
bottom_menu.xml in Resource Manager
<item
android:id="@+id/firstFragment"
android:icon="@drawable/ic_baseline_sticky_note"
android:title="@string/menu_first" />
<item
android:id="@+id/secondFragment"
android:icon="@drawable/ic_baseline_calendar"
android:title="@string/menu_second" />
<item
android:id="@+id/thirdFragment"
android:icon="@drawable/ic_baseline_person"
android:title="@string/menu_third" />
<item
android:id="@+id/fourFragment"
android:icon="@drawable/ic_baseline_settings"
android:title="@string/meu_fourth" />
QUESTION:
What I can do to push up the bottom navigation view to top of soft navigation bar when soft navigation bar open?