1

Now, my statuses are.

  1. Toolbar, ImageView, NestedScrollView, TabLayout and (NestedScrollView and RecyclerView in) ViewPager with PagerFragmentAdapter in Coordinator Layout

  2. I want to scroll smoothly in this Activty, with CoordinatorLayout.Behaviors.

  3. I think that should have 3 Behaviors with NestedScrollingChild, HeaderBehavior of First NestedScrollView and TabLayoutBehavior of TabLayout and ViewPagerBehavior of ViewPager (with NestedScrollView and RecyclerView).

  4. I don't know what how can manage their NestedScrolling.

  5. Please give me some advices or solutions.

Thanks :)

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?android:attr/actionBarSize"
        app:contentInsetEnd="0px"
        app:contentInsetStart="0px">

        <!-- Toolbar Layout Here -->
    </android.support.v7.widget.Toolbar>

    <ImageView
        android:id="@+id/iv_top_photo"
        android:layout_width="match_parent"
        android:layout_height="450dp"
        android:scaleType="centerCrop" />

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior=".HeaderBehavior">

        <LinearLayout
            android:id="@+id/header_content_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/white"
            android:orientation="vertical">

            <!-- Header Layout Here -->
        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>

    <android.support.design.widget.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFF"
            android:minHeight="?android:attr/actionBarSize"
            app:layout_behavior=".TabLayoutBehavior"
            app:tabIndicatorColor="@color/colorPrimary"
            app:tabIndicatorHeight="3dp"
            app:tabSelectedTextColor="@color/colorPrimary"
            app:tabTextColor="#000" />

    <android.support.v4.view.ViewPager
            android:id="@+id/view_pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            android:overScrollMode="never"
            app:layout_behavior=".ViewPagerBehavior" />
</android.support.design.widget.CoordinatorLayout>
Seho Noh
  • 96
  • 6

0 Answers0