I've got a ViewPager (backed by a AbstractBrowsePagerAdapter) composed of Fragments. Each fragment inflates a layout with a SwipeRefreshLayout as the root. I've recently updated to the support-v4:21.0.0 library. The new SwipeRefreshLayout uses a circle progress bar instead of the linear vertical progress bar as shown on the screenshot below.
When I pull to refresh, swipe right, create a new fragment in the ViewPager at the same index as the one where I pulled to refresh and then go to that new Fragment, the previous view still appears on top of my new content.
As you can see on the screenshot, the "empty directory" textview and the "circle progressbar" are still appearing from the previous fragment that was destroyed.
This seems like a bug in the new SwipeRefreshLayout but I couldn't find anybody having the same issue and it doesn't seem to be reported on https://code.google.com/p/android/issues/list?can=1&q=SwipeRefreshLayout&colspec=ID+Type+Status+Owner+Summary+Stars&cells=tiles
I'm looking for a workaround, forcing the views from the former fragment to be removed for good.
I was able to solve this issue by calling clearAnimation() on the onPause() method of my Fragment
@Override
public void onPause() {
swipeLayout.clearAnimation();
super.onPause();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With