Q:

Move View Up When Scrolling Listview in Fragment

I have below layout :
<android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"

        android:layout_height="match_parent"
        android:layout_marginBottom="65dp">

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

            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="@dimen/generic_toolbar_height"
                android:background="?attr/colorPrimary"
                android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                app:layout_scrollFlags="scroll|enterAlways"
                app:tabIndicatorColor="@android:color/white" />

            <LinearLayout
                android:id="@+id/cordinator"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
            <ImageView
                android:id="@+id/iv_header"
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:background="@color/add_item_header_bg"
                android:src="@mipmap/ic_shirt" />

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabGravity="fill"
                app:tabMode="scrollable" />
            </LinearLayout>

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

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

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

Where in viewPager the fragment is inserted and that fragments contains only listview .
My Issue  : I want the Image HeaderImage and TabLayout to scrool up on scrool of listview , but when i tried to detect scroll of listview and make the headerImage and tabLyaout gone the listview again got reset and hence position 0 is detected in scrolview hence the image and lablayout never moves up any alternative for this please suggest below is screenshot : 

A:

I suggest you to incorporate the image view in CollapsingaToolbar doing so would scroll upward, then with the animation you can also collapsing TableLayout

