Метод loadAfter библиотеки подкачки называется бесконечным во вложенном RecyclerView

У меня есть RecyclerView (ParentRV), который отображает список элементов. Каждый дочерний элемент (ViewHolder) представляет собой RecyclerView (ChildRV), который отображает список элементов.

Затем я реализую библиотеку подкачки для загрузки данных для ChildRV. Проблема заключается в том, что DataSource библиотеки пейджинга продолжает бесконечно вызывать метод loadAfter() после того, как я обновляю результат, возвращаемый из метода loadInitial(), в PagedListAdapter.

Любая помощь, пожалуйста! Вот макеты для ParentRV и ChildRV.

parent_layout.xml

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appBar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true">

                // ....

        </com.google.android.material.appbar.AppBarLayout>


        <com.example.ecommerce.presentation.widget.RefreshLayout
            android:id="@+id/refreshLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">


            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/sectionList"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false" />


        </com.example.ecommerce.presentation.widget.RefreshLayout>


    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</layout>

child_layout.xml

<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/productList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </FrameLayout>
</layout>

person Hoang Lam    schedule 11.06.2019    source источник
comment
Я думаю, вам нужно поставить adapter.setHasFixedSize(true). stackoverflow .com/questions/30079438/ Кроме того, если оба RecyclerView (родительский и дочерний) имеют вертикальную ориентацию, лучше использовать только один RecyclerView с разными типами представлений.   -  person Froyo    schedule 11.06.2019
comment
@Froyo Я пробовал, но все еще не работает.   -  person Hoang Lam    schedule 12.06.2019
comment
Ни у кого нет такой же проблемы, как у меня? Я думаю, что это обычный случай с вложенным recyclerview.   -  person Hoang Lam    schedule 18.06.2019
comment
У меня была такая же проблема, как это решить? метод loadAfter продолжает вызывать при первом вызове, без прокрутки вниз   -  person Nanda Z    schedule 14.12.2019