title: How to set height of ViewPager regardless of device screen height?
body: <p>I have a tab layout in <code>MainActivity</code> which has <code>ViewPager</code>, I am also adding bottom navigation to <code>MainActivity</code>, I want <code>ViewPager</code> to be of height that it touches the top of the bottom navigation.</p>
  
  <p>Here is my main activity layout</p>
  
  <pre><code> &lt;android.support.design.widget.CoordinatorLayout 
       xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:app="http://schemas.android.com/apk/res-auto"
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       xmlns:tools="http://schemas.android.com/tools"
       android:orientation="vertical"&gt;
  
  
  &lt;android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
      &lt;TextView
          android:id="@+id/logo"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:paddingBottom="10sp"
          android:paddingTop="10sp"
          android:textAlignment="center"
          android:layout_gravity="center"
          android:gravity="center"
          android:textColor="@color/white"
          android:textStyle="bold"
          android:textSize="40sp"
          android:text="@string/app_name" /&gt;
  
  
  
      &lt;android.support.design.widget.TabLayout
          android:id="@+id/tabs"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:tabMode="fixed"
          app:tabGravity="fill"/&gt;
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/viewpager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:layout_gravity="top"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"  /&gt;
  
       &lt;include layout="@layout/bottom_nav"&gt;&lt;/include&gt;
  
   &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Currently <code>ViewPager</code> spans full height behind bottom navigation bar. I want my <code>Viewpager</code> to be like below</p>
  
  <p><a href="https://i.stack.imgur.com/M6Ql0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M6Ql0.png" alt="enter image description here"></a></p>