Merge pull request #5341 from osmandapp/PaulsBranch
Fixed an issue with incorrect dialog in cologne
This commit is contained in:
commit
7ebce6878e
1 changed files with 4 additions and 3 deletions
|
@ -80,7 +80,8 @@ public class WikivoyageWebViewClient extends WebViewClient implements RegionCall
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
if (url.contains(WIKIVOAYAGE_DOMAIN)) {
|
boolean isWebPage = url.startsWith(PAGE_PREFIX_HTTP) || url.startsWith(PAGE_PREFIX_HTTPS);
|
||||||
|
if (url.contains(WIKIVOAYAGE_DOMAIN) && isWebPage) {
|
||||||
String lang = getLang(url);
|
String lang = getLang(url);
|
||||||
String articleName = getArticleNameFromUrl(url, lang);
|
String articleName = getArticleNameFromUrl(url, lang);
|
||||||
long articleId = app.getTravelDbHelper().getArticleId(articleName, lang);
|
long articleId = app.getTravelDbHelper().getArticleId(articleName, lang);
|
||||||
|
@ -90,11 +91,11 @@ public class WikivoyageWebViewClient extends WebViewClient implements RegionCall
|
||||||
warnAboutExternalLoad(url, context, nightMode);
|
warnAboutExternalLoad(url, context, nightMode);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (url.contains(WIKI_DOMAIN)) {
|
} else if (url.contains(WIKI_DOMAIN) && isWebPage) {
|
||||||
String lang = getLang(url);
|
String lang = getLang(url);
|
||||||
String articleName = getArticleNameFromUrl(url, lang);
|
String articleName = getArticleNameFromUrl(url, lang);
|
||||||
getWikiArticle(articleName, lang, url);
|
getWikiArticle(articleName, lang, url);
|
||||||
} else if (url.startsWith(PAGE_PREFIX_HTTP) || url.startsWith(PAGE_PREFIX_HTTPS)) {
|
} else if (isWebPage) {
|
||||||
warnAboutExternalLoad(url, context, nightMode);
|
warnAboutExternalLoad(url, context, nightMode);
|
||||||
} else if (url.startsWith(PREFIX_GEO)) {
|
} else if (url.startsWith(PREFIX_GEO)) {
|
||||||
if (article != null) {
|
if (article != null) {
|
||||||
|
|
Loading…
Reference in a new issue