0

This is my layout file.

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
            android:id="@+id/home_toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways|snap"
            app:titleTextColor="@color/colorWhite" />

        <android.support.design.widget.TabLayout
            android:id="@+id/home_tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimary"
            app:tabIndicatorColor="@color/colorWhite"
            app:tabIndicatorHeight="@dimen/tabIndicatorHeight"
            app:tabMinWidth="@dimen/tabMinWidth"
            app:tabMode="scrollable"
            app:tabSelectedTextColor="@color/colorWhite"
            app:tabTextColor="@color/colorWhite80" />

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/home_view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>

In CoordinatorLayout, there are 2 childs. One is AppBarLayout and another one is ViewPager. When I don't have so much thing to show in the ViewPager at that time also AppBarLayout is scrolling. I want to stop that scrolling. How can I achieve this?

Thanks in advance.

Avijit Karmakar
  • 8,890
  • 6
  • 44
  • 59
  • Doesn't [this](https://stackoverflow.com/questions/34108501/how-to-disable-scrolling-of-appbarlayout-in-coordinatorlayout) help you? – azizbekian Jan 28 '18 at 10:11
  • @azizbekian I have updated my question. Above link does not help me to solve this problem. I have already checked that before. – Avijit Karmakar Jan 28 '18 at 10:23

0 Answers0