CymChad / BaseRecyclerViewAdapterHelper

BRVAH:Powerful and flexible RecyclerAdapter
http://www.recyclerview.org/
MIT License
24.36k stars 5.16k forks source link

4.1.4版本-->NestedScrollView中嵌套加载更多,会导致onLoad()一直被执行 #6659

Open runitwolf-sloop opened 3 weeks ago

runitwolf-sloop commented 3 weeks ago
helper = new QuickAdapterHelper.Builder(adapter)
                .setTrailingLoadStateAdapter(new TrailingLoadStateAdapter.OnTrailingListener() {
                    @Override
                    public void onLoad() {
                        request()
                    }

                    @Override
                    public void onFailRetry() {
                        request()
                    }

                    @Override
                    public boolean isAllowLoading() {
                        return !binding.swipeRefreshLayout.isRefreshing();
                    }
                }).build();
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/swipeRefreshLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <androidx.core.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fillViewport="true">

                           <androidx.recyclerview.widget.RecyclerView
                                android:id="@+id/recycleview"
                                android:nestedScrollingEnabled="false"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content" />
            </androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>