From 2e6731a6546ccef78bfe15a0c2e37f70ad9d6c63 Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 3 Apr 2018 14:13:58 +0300 Subject: [PATCH] add title image to article --- .../plus/wikivoyage/WikivoyageArticleDialogFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageArticleDialogFragment.java index 2f257cec3e..36b8e66774 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageArticleDialogFragment.java @@ -22,6 +22,7 @@ import net.osmand.IndexConstants; import net.osmand.plus.R; import net.osmand.plus.wikivoyage.data.WikivoyageArticle; import net.osmand.plus.wikivoyage.data.WikivoyageSearchResult; +import net.osmand.util.Algorithms; import java.io.File; @@ -140,8 +141,13 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen if (article == null) { return; } + String articleTitle = "

" + article.getTitle() + "

"; - String content = HEADER_INNER + articleTitle + article.getContent() + FOOTER_INNER; + String articleTitleImage = ""; + if (!Algorithms.isEmpty(article.getImageTitle())) { + articleTitleImage = ""; + } + String content = HEADER_INNER + articleTitleImage + articleTitle + article.getContent() + FOOTER_INNER; contentWebView.loadDataWithBaseURL(getBaseUrl(), content, "text/html", "UTF-8", null); }