Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-04-20 11:02:09 +02:00
commit 27816a441a
3 changed files with 19 additions and 4 deletions

View file

@ -155,6 +155,19 @@ pre {
word-wrap: break-word;
}
.geo {
background-color: #fafafa;
border: 1px solid #e6e6e6;
border-radius: 5px;
padding: 2%;
color: #237bff;
font-size: 0.9em;
font-weight: bold;
text-align: center;
text-decoration: none;
display: inline-block;
}
td {
display: inline-block;
word-wrap: break-word;

View file

@ -18,6 +18,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.WikipediaDialogFragment;
import net.osmand.plus.wikivoyage.article.WikivoyageArticleDialogFragment;
import net.osmand.plus.wikivoyage.data.TravelArticle;
import net.osmand.plus.wikivoyage.explore.WikivoyageExploreDialogFragment;
@ -41,16 +42,18 @@ public class WikivoyageWebViewClient extends WebViewClient {
private FragmentManager fragmentManager;
private Context context;
private TravelArticle article;
private boolean nightMode;
private static final String PREFIX_GEO = "geo:";
private static final String PAGE_PREFIX_HTTP = "http://";
private static final String PAGE_PREFIX_HTTPS = "https://";
private static final String WEB_DOMAIN = ".wikivoyage.com/wiki/";
public WikivoyageWebViewClient(FragmentActivity context, FragmentManager fm) {
public WikivoyageWebViewClient(FragmentActivity context, FragmentManager fm, boolean nightMode) {
app = (OsmandApplication) context.getApplication();
fragmentManager = fm;
this.context = context;
this.nightMode = nightMode;
}
@Override
@ -124,8 +127,7 @@ public class WikivoyageWebViewClient extends WebViewClient {
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
context.startActivity(i);
WikipediaDialogFragment.showFullArticle(context, Uri.parse(url), nightMode);
}
})
.setNegativeButton(R.string.shared_string_cancel, null)

View file

@ -197,7 +197,7 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
webSettings.setJavaScriptEnabled(true);
updateWebSettings();
contentWebView.addJavascriptInterface(new WikivoyageArticleWebAppInterface(), "Android");
webViewClient = new WikivoyageWebViewClient(getActivity(), getFragmentManager());
webViewClient = new WikivoyageWebViewClient(getActivity(), getFragmentManager(), nightMode);
contentWebView.setWebViewClient(webViewClient);
return mainView;