1. Introduction
The Swiperefreshlayout and Recyclerview in the support package provided with Android will appear when the Recyclerview item is clipped, as shown in:
2. How to resolve this bug
The resources are as follows:
http://stackoverflow.com/questions/25178329/recyclerview-and-swiperefreshlayout/25227797#25227797
Https://gist.github.com/VladSumtsov/ad4e13511a9b73ff3b13
There are two workarounds shown above, and I recommend a second one that is simple, and my Code snippet is as follows:
Mlayoutmanager = new Linearlayoutmanager (getactivity ());// Mpiclistview is Recyclerview object Mpiclistview.setlayoutmanager (Mlayoutmanager); Mpiclistview.setonscrolllistener (new Onscrolllistener () {@Overridepublic void onscrollstatechanged (Recyclerview recyclerview,int newstate) { Super.onscrollstatechanged (Recyclerview, newstate);//Load more if (!isloading&& hasmore&& Madapter.getitemcount () = = (Mlayoutmanager.findlastvisibleitemposition () + 1) && newstate = = Recyclerview.scroll_state_idle) {isloading = True;requestserverarticlemore ();}} @Overridepublic void onscrolled (recyclerview recyclerview, int dx, int dy) {super.onscrolled (recyclerview, DX, dy);// Resolve Recyclerview and Swiperefreshlayout common bugmrefreshlayout.setenabled ( Mlayoutmanager.findfirstcompletelyvisibleitemposition () = = 0);});
Hope to be of help to you.
Fix bugs used by Android Swiperefreshlayout & Recyclerview