moved reset calls into new reset method of main activity
This commit is contained in:
parent
585c16ef72
commit
0fc57f8cfc
@ -632,15 +632,19 @@ public class IITC_Mobile extends Activity
|
|||||||
return url + (url.contains("?") ? '&' : '?') + "vp=" + (mDesktopMode ? 'f' : 'm');
|
return url + (url.contains("?") ? '&' : '?') + "vp=" + (mDesktopMode ? 'f' : 'm');
|
||||||
}
|
}
|
||||||
|
|
||||||
// inject the iitc-script and load the intel url
|
public void reset() {
|
||||||
// plugins are injected onPageFinished
|
|
||||||
public void loadUrl(String url) {
|
|
||||||
mNavigationHelper.reset();
|
mNavigationHelper.reset();
|
||||||
mMapSettings.reset();
|
mMapSettings.reset();
|
||||||
mUserLocation.reset();
|
mUserLocation.reset();
|
||||||
mIitcWebView.getWebViewClient().reset();
|
mIitcWebView.getWebViewClient().reset();
|
||||||
mBackStack.clear();
|
mBackStack.clear();
|
||||||
mCurrentPane = Pane.MAP;
|
mCurrentPane = Pane.MAP;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inject the iitc-script and load the intel url
|
||||||
|
// plugins are injected onPageFinished
|
||||||
|
public void loadUrl(String url) {
|
||||||
|
reset();
|
||||||
setLoadingState(true);
|
setLoadingState(true);
|
||||||
url = addUrlParam(url);
|
url = addUrlParam(url);
|
||||||
mIitcWebView.loadUrl(url);
|
mIitcWebView.loadUrl(url);
|
||||||
|
@ -225,13 +225,14 @@ public class IITC_WebViewClient extends WebViewClient {
|
|||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
|
public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
|
||||||
if (url.contains("conflogin") || url.contains("ServiceLogin") || url.contains("appengine.google.com")) {
|
if (url.contains("conflogin") || url.contains("ServiceLogin") || url.contains("appengine.google.com")) {
|
||||||
mIitcInjected = false;
|
|
||||||
Log.d("Google login");
|
Log.d("Google login");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (url.contains("ingress.com")) {
|
else if (url.contains("ingress.com")) {
|
||||||
if (!mIitcInjected) return false;
|
Log.d("intel link requested, reset app and load " + url);
|
||||||
mIitc.loadUrl(url);
|
mIitc.reset();
|
||||||
|
mIitc.setLoadingState(true);
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
Log.d("no ingress intel link, start external app to load url: " + url);
|
Log.d("no ingress intel link, start external app to load url: " + url);
|
||||||
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user