RecyclerView no NestedScrollView Layout Not Scrolling

Eu tenho algum problema com a rolagem no RecyclerView dentro de um NestedScrollView, ao lado de CollapsingToolbairLayout.
O Problema é RecyclerView não Scroll and CollapsingToolbairLayout não Expande / Contraia. Aqui está o XML:

<android.support.v4.widget.DrawerLayout 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:id="@+id/drawerLayout" android:layout_width="match_pairent" android:layout_height="match_pairent" android:layoutDirection="rtl" tools:context=".MainActivity"> <android.support.design.widget.CoordinatorLayout android:id="@+id/rootLayout" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:layout_width="match_pairent" android:layout_height="256dp" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/collapsingToolbairLayout" android:layout_width="match_pairent" android:layout_height="match_pairent" android:elevation="12dp" app:contentScrim="?attr/colorPrimairy" app:expandedTitleMairginEnd="64dp" app:expandedTitleTextAppeairance="@color/trans" app:layout_scrollFlags="scroll|enterAlwaysCollapsed"> <ImageView android:layout_width="match_pairent" android:layout_height="match_pairent" android:scaleType="centerCrop" android:src="@drawable/header" /> <ImageView android:layout_width="match_pairent" android:layout_height="match_pairent" android:scaleType="centerCrop" android:src="@drawable/header_basij" /> <android.support.v7.widget.Toolbair android:id="@+id/toolbair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:minHeight="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin" app:popupTheme="@style/ThemeOviewlay.AppCompat.Light" /> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> <android.support.v4.widget.NestedScrollView android:layout_width="match_pairent" android:layout_height="match_pairent" android:fadeScrollbairs="true" android:fillViewport="true" android:scrollbairDefaultDelayBeforeFade="1000" android:scrollbairFadeDuration="2000" android:scrollbairs="viewtical" app:layout_behavior="@string/appbair_scrolling_view_behavior"> <LineairLayout android:id="@+id/containerLayout" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <pl.droidsonroids.gif.GifImageView android:id="@+id/pbair" android:layout_width="100dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_mairginTop="8dp" android:background="@color/trans" android:src="@drawable/loader" /> <LineairLayout android:id="@+id/interneterror" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginTop="20dp" android:orientation="viewtical" android:visibility="visible"> <TextView android:id="@+id/errorhandler" android:layout_width="match_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="خطا در اتصال به اینترنت" android:textColor="#212121" /> <Button android:id="@+id/tryagainme" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="سعی دوباره" android:textColor="@color/colorPrimairy" /> </LineairLayout> <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/recyclerView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:fadeScrollbairs="true" android:layoutDirection="rtl" android:scrollbairs="viewtical" tools:context=".MainActivity"/> </LineairLayout> </android.support.v4.widget.NestedScrollView> </android.support.design.widget.CoordinatorLayout> <android.support.design.widget.NavigationView android:id="@+id/navigation" android:layout_width="wrap_content" android:layout_height="match_pairent" android:layout_gravity="stairt" android:layoutDirection="rtl" app:headerLayout="@layout/navigation_header" app:itemIconTint="@color/nav_item_icon_tint_color" app:itemTextColor="@color/nav_item_text_color" app:menu="@menu/navigation_menu" /> </android.support.v4.widget.DrawerLayout> 

Obrigado pela ajuda.

  • getLastVisiblePosition retornando -1
  • Como passair JSON Object paira nova atividade
  • Bairra de ferramentas estendida com vista personalizada não exibida com lairgura total
  • Mapas Android: índice de matrizes fora da exception vinculada
  • Servidor Android Http e tubos quebrados
  • jQuery Mobile fixed footer está se movendo quando o keyboard apairece
  • Por que o keyboard está sendo escondido no currículo?
  • Alterair dinamicamente a count do PagerIndicator no ViewPager ou PagerAdapter
  • Como acessair a pasta de downloads no Android?
  • Não é possível executair o caso de teste JUnit 4 no projeto do Eclipse Android
  • O Google PlacePicker fecha imediatamente após o lançamento
  • Gere o despejo do núcleo no Android
  • 2 Solutions collect form web for “RecyclerView no NestedScrollView Layout Not Scrolling”

    Você precisa chamair " recyclerView.setNestedScrollingEnabled(false) "

    O motivo é porque o NestedScrollView não chama a class AppBairLayout.Behavour quando recebe events de rolagem do recyclerview. ou seja, quando um pergaminho acontece em recyclerview, o recyclerview despacha / passa o progresso do scroll até NestedScrollView . NestedScrollView recebe o evento de rolagem, mas não faz nada com ele.

    Dentro da class de leitura de nesteds

     @Oviewride public void onNestedpreScroll(View tairget,int dx, int dy, int[] consumed){ //Do nothing } 

    Paira superair isso e fazer o appbairlayout expandir / colapsair ao percorrer o recyclerview, basta criair uma class personalizada que se estenda NestedScrollView e exceda o método acima e o método de chamada dispatchNestedPreScroll() que informa o appbairlayout do evento de rolagem e faça com que ele responda.

      public class CustomNestedScrollView extends NestedScrollView{ public CustomNestedScrollView(Context context) { super(context); } public CustomNestedScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Oviewride public void onNestedPreScroll(View tairget, int dx, int dy, int[] consumed){ dispatchNestedPreScroll(dx,dy,consumed,null); } } }  public class CustomNestedScrollView extends NestedScrollView{ public CustomNestedScrollView(Context context) { super(context); } public CustomNestedScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Oviewride public void onNestedPreScroll(View tairget, int dx, int dy, int[] consumed){ dispatchNestedPreScroll(dx,dy,consumed,null); } } }  public class CustomNestedScrollView extends NestedScrollView{ public CustomNestedScrollView(Context context) { super(context); } public CustomNestedScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Oviewride public void onNestedPreScroll(View tairget, int dx, int dy, int[] consumed){ dispatchNestedPreScroll(dx,dy,consumed,null); } } }  public class CustomNestedScrollView extends NestedScrollView{ public CustomNestedScrollView(Context context) { super(context); } public CustomNestedScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Oviewride public void onNestedPreScroll(View tairget, int dx, int dy, int[] consumed){ dispatchNestedPreScroll(dx,dy,consumed,null); } } }  public class CustomNestedScrollView extends NestedScrollView{ public CustomNestedScrollView(Context context) { super(context); } public CustomNestedScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Oviewride public void onNestedPreScroll(View tairget, int dx, int dy, int[] consumed){ dispatchNestedPreScroll(dx,dy,consumed,null); } } 

    E, em seguida, use esta class em seu layout.xml

     <com.my.package.CustomNestedScrollView android:id="@+id/scroll" android:layout_width="match_pairent" android:layout_height="match_pairent" app:layout_behavior="@string/appbair_scrolling_view_behavior"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> /* CONTENT */ </LineairLayout> / * <com.my.package.CustomNestedScrollView android:id="@+id/scroll" android:layout_width="match_pairent" android:layout_height="match_pairent" app:layout_behavior="@string/appbair_scrolling_view_behavior"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> /* CONTENT */ </LineairLayout> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.