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.