J'ai donc une activité qui utilise un NestedScrollView et à l'intérieur de ce NestedScrollView se trouve un ViewPager. Ce ViewPAger contient 2 fragments. L'un a des layouts à l'intérieur du scrollview et l'autre a un recyclerView.
Mais les deux fragments ne défilent pas (ni scrollview ni recyclerview).
Activité XML
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorPrimary"
android:orientation="vertical">
// Some Textview & imagehview here
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/ll_header"
android:orientation="vertical">
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/movietab"
android:layout_width="match_parent"
android:layout_height="@dimen/_40sdp"
android:background="@color/colorAccent"
android:paddingBottom="@dimen/_2sdp"
app:stl_defaultTabTextColor="@color/white"
app:stl_defaultTabTextHorizontalPadding="@dimen/_20sdp"
app:stl_distributeEvenly="true"
app:stl_indicatorColor="@color/white"
app:stl_indicatorCornerRadius="1dp"
app:stl_indicatorInterpolation="smart"
app:stl_indicatorThickness="3dp"
app:stl_underlineColor="@color/transparent" />
<android.support.v4.view.ViewPager
android:id="@+id/mViewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/movietab" />
</RelativeLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
Fragment1 XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/color1">
<ScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:fillViewport="true">
<LinearLayout
android:id="@+id/llInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
//Inner Layout
</LinearLayout>
</ScrollView>
</RelativeLayout>
Fragment2 XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/llCasting"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.movies.MovieCastFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/rvCast"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
J'ai essayé android:nestedScrollingEnabled=""
vrai et faux sur chaque mise en page, mais je n'ai jamais obtenu le résultat souhaité.
Les ScrollView et RecyclerView de Fragment défilent mais je ne veux pas les faire défiler, je veux faire défiler le Nested ScrollVIew de Activity.