moved reset calls into new reset method of main activity

This commit is contained in:
Philipp Schaefer 2014-08-19 02:29:02 +02:00
parent 585c16ef72
commit 0fc57f8cfc
2 changed files with 11 additions and 6 deletions

View File

@ -632,15 +632,19 @@ public class IITC_Mobile extends Activity
return url + (url.contains("?") ? '&' : '?') + "vp=" + (mDesktopMode ? 'f' : 'm');
}
// inject the iitc-script and load the intel url
// plugins are injected onPageFinished
public void loadUrl(String url) {
public void reset() {
mNavigationHelper.reset();
mMapSettings.reset();
mUserLocation.reset();
mIitcWebView.getWebViewClient().reset();
mBackStack.clear();
mCurrentPane = Pane.MAP;
}
// inject the iitc-script and load the intel url
// plugins are injected onPageFinished
public void loadUrl(String url) {
reset();
setLoadingState(true);
url = addUrlParam(url);
mIitcWebView.loadUrl(url);

View File

@ -225,13 +225,14 @@ public class IITC_WebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
if (url.contains("conflogin") || url.contains("ServiceLogin") || url.contains("appengine.google.com")) {
mIitcInjected = false;
Log.d("Google login");
return false;
}
else if (url.contains("ingress.com")) {
if (!mIitcInjected) return false;
mIitc.loadUrl(url);
Log.d("intel link requested, reset app and load " + url);
mIitc.reset();
mIitc.setLoadingState(true);
return false;
} else {
Log.d("no ingress intel link, start external app to load url: " + url);
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));