diff --git a/OsmAnd/assets/article_style.css b/OsmAnd/assets/article_style.css index d07ddc8ba0..071fe4455b 100755 --- a/OsmAnd/assets/article_style.css +++ b/OsmAnd/assets/article_style.css @@ -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; diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java index e72f83939c..705a6fc14e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java @@ -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) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 76caaacf0f..2a54cbf3e1 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -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;