Skip to content

Bug 1173789 - Showing Network activity spinner#658

Merged
st3fan merged 1 commit intomozilla-mobile:masterfrom
kar1m:karim/Bug1173789NetworkActivitySpinner
Jul 10, 2015
Merged

Bug 1173789 - Showing Network activity spinner#658
st3fan merged 1 commit intomozilla-mobile:masterfrom
kar1m:karim/Bug1173789NetworkActivitySpinner

Conversation

@kar1m
Copy link
Copy Markdown
Contributor

@kar1m kar1m commented Jun 30, 2015

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too simple.

For example, when the WKWebView fails to load and finishes via didFailNavigation:, the network spinner is never stopped.

Also, when a page loads and is put in the background because you open a new tab, the navigation delegate for the BrowserViewController is switched around so you will never receive a didFinish or didFail. So it may be better to do this in the TabManager which is a WKNavigationDelegate for all open tabs.

I think we should use an atomic counter to keep track of the state of all open tabs combined. So that multiple tabs can increment and decrement the spinner state counter and then networkActivityIndicatorVisible can be configured based on that.

Just keep in mind that there are many tabs loading at the same time.

@st3fan
Copy link
Copy Markdown
Contributor

st3fan commented Jul 8, 2015

@kar1m I don't have a good feeling about this because there is so much state that we need to track. I am wondering if we can do this in a different way.

For example, the WKWebView has a loading property. What do you think of using that? We could use KVO to receive loading state changes and based on that show/hide the spinner. Then there is just one thing we need to look at.

You could use loading as a trigger. If it changes to true then you know you need to start the spinner. If it changes to false then you could loop over all WKWebView instances that we have and quickly see if any one of them is still loading or not. And do the same check after a tab is closed.

st3fan added a commit that referenced this pull request Jul 10, 2015
…nner

Bug 1173789 - Showing Network activity spinner
@st3fan st3fan merged commit ddea35a into mozilla-mobile:master Jul 10, 2015
ecotopian referenced this pull request in ecosia/ios-browser Mar 1, 2022
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
* Fixes mozilla-mobile#629 - Updates Telemetry

* move the foreground event to didBecomeActive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants