android - Viewpager is Not Scrolling when kept with Recylerview -


i using viewpager , recyclerview in framelayout.

<framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".homeactivity">  <android.support.v4.view.viewpager     android:id="@+id/top_container"     android:layout_width="match_parent"     android:layout_height="300dp"     />  <android.support.v7.widget.recyclerview     android:id="@+id/regular_view"     android:cliptopadding="false"     android:paddingtop="300dp"     android:layout_width="match_parent"     android:layout_height="match_parent"  /> 

i want hide viewpager on scroll of recyclerview vertically. working. scroll of viewpager not working. why happening ?

here example drawer layout used implement left navigation drawer

<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent">  <linearlayout     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical"     android:fitssystemwindows="true">      <include         android:id="@+id/app_bar_main_activity"         android:layout_width="fill_parent"         android:layout_height="@dimen/app_bar_height"         layout="@layout/app_bar" />      <framelayout         android:id="@+id/frame_container"         android:layout_width="fill_parent"         android:layout_height="fill_parent">      </framelayout>  </linearlayout>  <fragment     android:id="@+id/navigation_drawer"     android:layout_width="280dp"     android:layout_height="fill_parent"     android:layout_gravity="start"     android:name="sub.fragments.navigationdrawer"     tools:layout="@layout/fragment_navigation_drawer"     app:layout="@layout/fragment_navigation_drawer">  </fragment> 

in linear layout acts host different layout separate fragments can replaced framlayout

and next fragment can want, here's fragment can have recyclerview

enter image description here


Comments