Closed Bug 1007408 Opened 11 years ago Closed 11 years ago

Throttle onrefresh calls in home panels

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

If a user does a pull-to-refresh action while the view is currently refreshing, we shouldn't let them trigger a second refresh.
With this patch, we avoid sending a message to Java to call the view's onrefresh handler if the view is currently being refreshed. In order to get this to work, I had to change the ordering of the logic in GeckoSwipeRefreshLayout#startRefresh. The only other GeckoSwipeRefreshLayout consumer in the tree is RemoteTabsContainer, and that won't be affected by this change. As much as I'm not a fan of modifying the source we took from Android's SwipeRefreshLayout.java, this seems like the easiest way to do what I want :)
Assignee: nobody → margaret.leibovic
Attachment #8419068 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 8419068 [details] [diff] [review] Don't call refresh handler if view is already being refreshed Review of attachment 8419068 [details] [diff] [review]: ----------------------------------------------------------------- Hmm... this patch changes the behaviour of the widget to something I'd consider a bit unexpected. Isn't this something add-ons should handle themselves anyway? Not only for pull-to-refresh but any case where they end up with overlapping refresh calls. I'd prefer a solution that doesn't involve changing the widget. So, if we really want to handle this in the UI, maybe just post a runnable on the UI thread and check the refreshing state there?
Attachment #8419068 - Flags: review?(lucasr.at.mozilla)
Thinking about this a bit more, I'm starting to agree this is something that add-ons could just handle themselves. I wanted to try to make this part of the browser logic to make life easier for add-ons, but I also don't want to limit their power. I can imagine add-ons doing different things to handle this on their own (canceling an existing request vs. avoiding sending a new request), so perhaps this bug should just be a WONTFIX.
Let's just make add-ons deal with this :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: