Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecyclerView render issue if wrapped inside NestedScrollView #400

Open
punitshah89 opened this issue Jan 24, 2018 · 5 comments
Open

RecyclerView render issue if wrapped inside NestedScrollView #400

punitshah89 opened this issue Jan 24, 2018 · 5 comments
Labels

Comments

@punitshah89
Copy link

punitshah89 commented Jan 24, 2018

  • [x ] I have searched existing issues and confirmed this is not a duplicate

Issues and steps to reproduce

RecyclerView is not showing all items when list is long when used with FlexboxLayoutManager

  1. Wrap RecyclerView with android:nestedScrollingEnabled="false" inside NestedScrollView
  2. Create and add FlexboxLayoutManager to RecyclerView
  3. Load recycler view with long list of items

Expected behavior

RecyclerView should render all items

Version of the flexbox library

0.3.1, 0.3.2

Code example based on repro steps

<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
   android:id="@+id/nested_scroll_view"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fillViewport="true"
   android:scrollbars="none"
   app:layout_behavior="@string/appbar_scrolling_view_behavior">
       <android.support.v7.widget.RecyclerView
           android:id="@+id/recycler_view"
           android:nestedScrollingEnabled="false"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
       />
</android.support.v4.widget.NestedScrollView>
RecyclerView.LayoutManager layoutManager = new FlexboxLayoutManager(this.getContext());
mRecyclerView.setLayoutManger(layoutManager);
@thagikura thagikura added the bug label Jan 25, 2018
@thagikura
Copy link
Contributor

thagikura commented Jan 25, 2018

Thanks for the report. Confirmed the behavior, but I don't come up with a usecase where RecyclerView is wrapped with a NestedScrollView in practice.

In what usecase do you expect that situation?

@punitshah89
Copy link
Author

punitshah89 commented Jan 25, 2018

Thanks for your quick reply, In my case I'm using multiple views including customRecyclerView inside NestedScrollView, where I want to make whole screen scroll instead of RecyclerView.

@thagikura
Copy link
Contributor

But NestedScrollView if able to have only a single direct child. So it's not possible to make the entire screen scrollable including RecyclerView, no?

@punitshah89
Copy link
Author

punitshah89 commented Jan 26, 2018

Yes we can add root element to all views and screen is scrollable, in my case I'm using RelativeLayout and following structure.

<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
   android:id="@+id/nested_scroll_view"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fillViewport="true"
   android:scrollbars="none"
   app:layout_behavior="@string/appbar_scrolling_view_behavior">

<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

<Otherviews />
<CustomRecyclerView />

</RelativeLayout>
</android.support.v4.widget.NestedScrollView>

@thagikura
Copy link
Contributor

Oh so the actual XML was different from the one you pasted in the first comment. Understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants