SmartRefreshLayout icon indicating copy to clipboard operation
SmartRefreshLayout copied to clipboard

上拉加载可能出现多次触发

Open BaiShou opened this issue 5 years ago • 6 comments

详细描述 在上拉加载完成并且标记没有更多数据的瞬间,再次上拉会再次触发上拉加载事件

使用版本

com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'

使用代码

mRefreshLayout.finishLoadMoreWithNoMoreData()

布局代码

<com.scwang.smartrefresh.layout.SmartRefreshLayout
            android:id="@+id/mRefreshLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            app:srlAccentColor="@android:color/white"
            app:srlEnablePreviewInEditMode="true"
            app:srlPrimaryColor="#0fff">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/mRecyclerContent"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </com.scwang.smartrefresh.layout.SmartRefreshLayout>

问题重现 问题重现操作步骤: 1、当第二页数据量少 2、加载完成瞬间再次上拉,上拉瞬间能看到加载完成字样

预期行为 上拉多次触发

设备信息 请填写一下你运行设备的信息,信息越全越有助于我理解问题

  • 设备名: 小米note3
  • Android版本: [e.g. Android 9.0]

BaiShou avatar Feb 11 '20 08:02 BaiShou

我也遇到了同样的问题,如果是viewpager装载的fragment,先进入带有列表的fragment不做任何刷新,然后切换到别的framgent再回来,这个时候加载更多是会触发多次的,因为每次执行RecyclerViewScrollComponent里面的attach方法这样就会添加多个ScrollListener

androidfei avatar Mar 02 '20 08:03 androidfei

我现在做的处理就是在attach记录在每次重新添加之前把当前的监听remove掉,然后在添加新的

androidfei avatar Mar 02 '20 08:03 androidfei

我现在做的处理就是在attach记录在每次重新添加之前把当前的监听remove掉,然后在添加新的

RecyclerViewScrollComponent这个类在哪里

BaiShou avatar Mar 02 '20 08:03 BaiShou

我现在做的处理就是在attach记录在每次重新添加之前把当前的监听remove掉,然后在添加新的

不行的吧,在当前页面上拉正在加载时,快速的多次上拉,可以加载好多次,如果是在末尾,末尾的数据会重复。而且还会回到顶部,诡异。使用的库:1.1.2

MoYuFly avatar Apr 28 '20 09:04 MoYuFly

同样遇到这个问题,有解决方案了吗?

czh2774 avatar Sep 08 '20 14:09 czh2774

同样的问题,快速下拉会多出一页,42条数据每页10条会加载到第6页

zengss avatar Jun 10 '22 08:06 zengss