scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.79k stars 4.93k forks source link

使用StaggeredGridLayoutManager后会出现卡顿,滑动到最后一个时可能出现截取一半的情况 #1568

Open 123cdy opened 1 month ago

123cdy commented 1 month ago

StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(spanCount, orientation); staggeredGridLayoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE); staggeredGridLayoutManager.setItemPrefetchEnabled(false); <com.scwang.smart.refresh.layout.SmartRefreshLayout android:id="@+id/mySmartRefresh" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" app:layout_constrainedHeight="true" app:srlEnableAutoLoadMore="false" app:srlEnableFooterFollowWhenLoadFinished="true" app:srlEnableLoadMore="false" app:srlEnableLoadMoreWhenContentNotFull="false" app:srlFinishDuration="0" app:srlFooterHeight="@dimen/dp_40" app:srlFooterMaxDragRate="40" app:srlReboundDuration="100">

<androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_list"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:background="@color/color_f6f6f6"
            android:focusable="false"
            android:focusableInTouchMode="false"
            android:nestedScrollingEnabled="false"
            android:overScrollMode="never"
            android:paddingEnd="@dimen/dp_8"
            app:itemAnimator="@{null}"
            app:itemBinding="@{viewModel.itemBinding}"
            app:items="@{viewModel.itemVMList}"
            app:layoutManager="@{LayoutManagers.staggAeredGrid(2,StaggeredGridLayoutManager.VERTICAL)}" />

    </com.scwang.smart.refresh.layout.SmartRefreshLayout>