How to hide bottom TabLayout once keyboard shows up?
<p>I am using bottom <code>TabLayout</code> with <code>ViewPager</code> above the tabs, XML listed below:</p>

<pre><code>&lt;RelativeLayout
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;include
        android:id="@+id/toolbar_wrapper"
        layout="@layout/toolbar_main" /&gt;

    &lt;android.support.design.widget.TabLayout
        android:id="@+id/tabs_bottom_main"
        style="@style/AppTabLayout"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_alignParentBottom="true"
        app:tabGravity="fill" /&gt;

    &lt;View
        android:id="@+id/view_black_line"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_above="@id/tabs_bottom_main"
        android:background="@android:color/black" /&gt;

    &lt;NonSwipableViewPager
        android:id="@+id/view_pager_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/view_black_line"
        android:layout_below="@id/toolbar_wrapper"
        android:background="@android:color/white" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>When the keyboard shows up, the whole <code>View</code> pushed up, I would like to hide the bottom <code>TabLayout</code> only (but keep the <code>ViewPager</code> above) once the keyboard shows up. How to achieve it?</p>

<p><strong>P.S.</strong></p>

<p>I have tried listening the keyboard show up event and set <code>TabLayout</code> visibility with <code>mBottomTabLayout.setVisibility(isOpen ? View.GONE : View.VISIBLE);</code></p>

<p>But this will hide the whole <code>ViewPager</code> together with the <code>TabLayout</code>.</p>