android / views-widgets-samples

Multiple samples showing the best practices in views-widgets on Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ViewPager2] itemCount > 3 , SwipeRefreshView can't work

309152665 opened this issue · comments

if ViewPager2 itemCount > 3 , such as 4 , ViewPager2 childs is SwipeRefreshView + RecyclerView , position 0 , pull refresh network data(before request SwipeRefreshView.isRefreshing = true , after network data complete , SwipeRefreshView.isRefreshing = false ) , fast switch to lastIndex , and switch back in a while , repeat the opera , sometimes the SwipeRefreshView can't pull refresh .
if i set ViewPager2.offscreenPageLimit = 1 , it work well , but , when ViewPager2.itemCount = 4 , i must set ViewPager2.offscreenPageLimit = 2.......

Screenrecorder-2021-06-24-13-42-30-658.mp4

the record SwipeRefreshView.isRefreshing=1 ,
some code :
image
image