ViewPager not showing inside ScrollView. Without scrollview my viewpager is working perfectly fine!!

I tried to wrap viewpager inside another layout, I tried scrollview to wrap inside another relative layout and some other ways, but none of working.

What should I do now? Please see below XML file

What I tried:

```
android:fillViewport="true"
        android:fitsSystemWindows="true"

```

Code:

```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".MainActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorPrimary"
        android:theme="@style/AppTheme.AppBarOverlay">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/map"
                android:layout_width="25dp"
                android:layout_height="25dp"
                android:layout_marginLeft="6dp"
                android:layout_marginTop="10dp"
                android:src="@drawable/map"
                android:tint="@color/colorRed" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="10dp"
                android:layout_toRightOf="@+id/map"
                android:fontFamily="sans-serif"
                android:textColor="@color/colorBlack"
                android:text="Phase - 1, Peenya, Bengaluru"
                android:textSize="16sp" />

            <ImageView
                android:id="@+id/pay"
                android:layout_width="25dp"
                android:layout_height="25dp"
                android:layout_marginTop="10dp"
                android:layout_toLeftOf="@+id/profile_pic"
                android:layout_marginRight="8dp"
                android:src="@drawable/ic_baseline_payment_24"
                android:tint="@color/colorBlack" />

            <ImageView
                android:id="@+id/profile_pic"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:layout_alignParentEnd="true"
                android:layout_marginTop="10dp"
                android:layout_marginRight="5dp"
                android:src="@drawable/circle_profile1" />

        </RelativeLayout>

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorWhite">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginRight="6dp"
                android:orientation="vertical">

                <EditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/rounded_edittext_states"
                    android:hint="Search for restaurants, cuisines..."
                    android:textColorHint="@color/colorDarkGray"
                    android:textColor="@color/colorBlack"
                    android:padding="10dp" />

            </LinearLayout>

        </androidx.appcompat.widget.Toolbar>

        <com.google.android.material.tabs.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabGravity="fill"
            app:tabIndicatorColor="@color/colorRed"
            app:tabMode="fixed"
            app:tabTextColor="@color/colorBlack" />
    </com.google.android.material.appbar.AppBarLayout>

    <ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/app_bar">

    <androidx.viewpager.widget.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    </ScrollView>

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:itemBackground="@color/colorPrimary"
        app:itemIconTint="@color/colorBlack"
        app:itemTextColor="@color/colorWhite"
        app:menu="@menu/bottom_navigation_main" />

</RelativeLayout>

```