0

I have a MainActivity that has a android.support.design.widget.BottomNavigationView and a FrameLayout init:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.virascience.app.MainActivity"
    tools:showIn="@layout/app_bar_main">

    <FrameLayout
        android:id="@+id/main_container"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="@dimen/actionBarSize"
        tools:context="com.virascience.app.MainActivity">

    </FrameLayout>

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="0dp"
        android:layout_marginStart="0dp"
        android:background="?android:attr/windowBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/navigation" />

</android.support.constraint.ConstraintLayout>

Now when I clicked on SearchView in one of my fragments, BottomNavigationView goes up with the keyboard.

I tried this code in AndroidManifest.xml but not working for me:

android:windowSoftInputMode="adjustPan"

How can I hide BottomNavigationView when keyboard opens?

Behrooz Fard
  • 448
  • 3
  • 21
  • [This](https://stackoverflow.com/questions/25216749/softkeyboard-open-and-close-listener-in-an-activity-in-android) post might help you answer. You can set your view based on visibility of your keyboard – phonemyatt Nov 22 '17 at 16:09
  • You can check this - https://stackoverflow.com/a/35267926/2128166 – Wasim K. Memon Nov 22 '17 at 16:11

0 Answers0