* moved necessary resets to from reloadIITC() to loadURL()
* better url parameter add * fixed wrong return value of shouldOverrideUrlLoading()
This commit is contained in:
parent
a687ab82ea
commit
0a461ab753
@ -623,29 +623,24 @@ public class IITC_Mobile extends Activity
|
||||
}
|
||||
|
||||
public void reloadIITC() {
|
||||
mNavigationHelper.reset();
|
||||
mMapSettings.reset();
|
||||
mUserLocation.reset();
|
||||
mIitcWebView.getWebViewClient().reset();
|
||||
mBackStack.clear();
|
||||
// iitc starts on map after reload
|
||||
mCurrentPane = Pane.MAP;
|
||||
loadUrl(mIntelUrl);
|
||||
mReloadNeeded = false;
|
||||
}
|
||||
|
||||
// vp=f enables mDesktopMode mode...vp=m is the default mobile view
|
||||
private String addUrlParam(final String url) {
|
||||
if (mDesktopMode) {
|
||||
return (url + "?vp=f");
|
||||
} else {
|
||||
return (url + "?vp=m");
|
||||
}
|
||||
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) {
|
||||
mNavigationHelper.reset();
|
||||
mMapSettings.reset();
|
||||
mUserLocation.reset();
|
||||
mIitcWebView.getWebViewClient().reset();
|
||||
mBackStack.clear();
|
||||
mCurrentPane = Pane.MAP;
|
||||
setLoadingState(true);
|
||||
url = addUrlParam(url);
|
||||
mIitcWebView.loadUrl(url);
|
||||
|
@ -232,12 +232,11 @@ public class IITC_WebViewClient extends WebViewClient {
|
||||
Log.d("should be an internal clicked position link...reload script for: " + url);
|
||||
mIitc.loadUrl(url);
|
||||
}
|
||||
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));
|
||||
mIitc.startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user