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; 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 { td {
display: inline-block; display: inline-block;
word-wrap: break-word; word-wrap: break-word;

View file

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

View file

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