The ViewPager
has two Fragment
s,one Fragment
's layout contains a NestedScrollView
, another one's layout contains a RecyclerView
, when I scroll the NestedScrollView
to the bottom, here is a demand that user click the whole title region all CoordinatorLayout
's content must scroll to top same as the beginning. but I don't know how to do that with CoordinatorLayout
. it seems that there's no api method that support my demand.
Here is my layout xml:
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinate_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:fitsSystemWindows="true"
android:background="?attr/color_26"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
app:tabTextColor="?attr/color_8"
app:tabSelectedTextColor="?attr/color_18"
app:tabIndicatorHeight="0dp"
app:tabGravity="fill"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="42dp">
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
</android.support.design.widget.CoordinatorLayout>