0

I have following layout:

enter image description here

What I would like to achieve is to scroll out the ViewPager out of the screen when you scroll in any of the listviews at the half bottom of the screen. As the ViewPager would be getting out of the screen the ListViews should take up more and more screen. Toolbar should stay pinned.

I was having look at the Support Design Library.

In my case from the examples the most interesting piece of code was this:

<android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

     <! -- Your Scrollable View -->
    <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
   <android.support.v7.widget.Toolbar
                  ...
                  app:layout_scrollFlags="scroll|enterAlways">

        <android.support.design.widget.TabLayout
                  ...
                  app:layout_scrollFlags="scroll|enterAlways">
     </android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>

Do I need to change my ListViews to RecyclerViews in order to achieve scrolling out the ViewPager from the screen - while the ListViews would increase their height as the ViewPager would getting out of the screen? Is that even possible with the Coordinator Layout?

Jakub Holovsky
  • 6,543
  • 10
  • 54
  • 98
  • 1
    github.com/florent37/MaterialViewPager you can use this library. – HourGlass Dec 17 '15 at 15:09
  • 1
    ListView supports nested scrolling only on API > 21 (See http://stackoverflow.com/questions/32811121/listview-nested-scrolling-on-api21 ). So you either target these devices or use RecyclerView. – Capricorn Dec 17 '15 at 15:15

0 Answers0