N
N
Nubbin2017-07-25 08:25:18
Android
Nubbin, 2017-07-25 08:25:18

RecyclerView and NestedScrollView?

Good morning guys I have a little problem with pagination.
I just can’t figure it out, this code does not respond to pagination and receives all the data at once, I don’t know how it happens

<android.support.v4.widget.NestedScrollView
        android:id="@+id/nested_scroll"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#edeef0"
        android:fillViewport="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">
        <android.support.v7.widget.RecyclerView
            android:id="@+id/list_items"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        </android.support.v7.widget.RecyclerView>
    </android.support.v4.widget.NestedScrollView>

There is no such problem with this structure, it loads 10 results, then when I scroll to the end of the list, it loads another 10, and with the first example it loads everything at once, what's the problem here, help yes.
<ScrollView
        android:id="@+id/nested_scroll"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#edeef0"
        android:fillViewport="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">
        <android.support.v7.widget.RecyclerView
            android:id="@+id/list_items"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        </android.support.v7.widget.RecyclerView>
    </ScrollView>

On the internet I write that I need to add " setNestedScrollingEnabled (false); " does not help
llm = new LinearLayoutManager(this);

listItems.setLayoutManager(llm);
        listItems.setAdapter(adapter);
        listItems.setNestedScrollingEnabled(false);
        scrollListener = new EndlessRecyclerViewScrollListener(llm) {
            @Override
            public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {
                Log.d("sadasdas", "1123");
            }
        };
        listItems.addOnScrollListener(scrollListener);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Akimov, 2021-07-30
@antaki93

I don't really understand what the question is about. But the call setNestedScrollingEnabled(false)solved my nested RecyclerView scrolling issue????

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question