Closed mooocer closed 6 years ago
The problem is that a view only has one showProgress contract and we want a pull to refresh progress indicator, but it does not look good when loading items. What do you propose
@iamareebjamal Can we use any of these?
setRefreshing(false)
in the OnRefeshListener
's onRefresh()
method. This one seems to be a concise and better solution.Still can't understand how any of these will solve both of these being triggered. Can you elaborate?
Yes. SwipeRefreshLayout
's setRefreshing(false)
is used to tell the widget that the loading has finished i.e. to hide the ProgressBar. The SwipeRefreshLayout's progress bar will be hidden immediately after the refresh is triggered. But the other ProgressBar will keep behaving normally.
This means that as you pull down, the small ProgressBar will be visible and move to show that fragment supports SwipeToRefresh. But once you swipe down fully and activate refresh, the smaller ProgressBar will be hidden immediately, and only the bigger (better looking) ProgressBar will be visible throughout the refresh.
The other 2 solutions will replace the default drawable provided by SwipeToRefresh layout, and we can completely disable the manually triggered ProgressBar.
OK, sounds good. Looks good. What happens on a screen where there are no items?
I found out that in the current state of the app if we swipe down in case of no items, the spinner doesn't appear to move. This is also a UI glitch as the user then won't know that fragment supports SwipeToRefresh feature (in case of no items), unless they accidently swipe down.
Otherwise, it works same as described above in case of no items as well.
OK, please go ahead and implement this
Thanks! I'll send a PR right away.
@iamareebjamal Please review!
@iamareebjamal This issue is similar one but the multiple progress bar here are present in the dashboard.
Is it a ?
[x] Bug Report
[ ] Feature Request
[ ] Chore
Bug Report
Actual Behaviour
When swiped down to refresh, two progress bars appear simultaneously (one from the SwipeRefreshLayout, and other from the "included" progressbar_layout.xml)
Expected Behaviour
Only one of the progress bars should be displayed as double progress bars make the UI look odd.
Steps to reproduce it
Swipe down to refresh
Screenshot of the issue
Would you like to work on the issue?
Yes