add style background-image to article image
This commit is contained in:
parent
24ba4688e8
commit
42475b1956
1 changed files with 3 additions and 2 deletions
|
@ -40,7 +40,7 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
|
||||||
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n" +
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n" +
|
||||||
"<meta http-equiv=\"cleartype\" content=\"on\" />\n" +
|
"<meta http-equiv=\"cleartype\" content=\"on\" />\n" +
|
||||||
"<link href=\"article_style.css\" type=\"text/css\" rel=\"stylesheet\"/>\n" +
|
"<link href=\"article_style.css\" type=\"text/css\" rel=\"stylesheet\"/>\n" +
|
||||||
"</head><body>";
|
"</head><body>\n";
|
||||||
private static final String FOOTER_INNER = "</div></body></html>";
|
private static final String FOOTER_INNER = "</div></body></html>";
|
||||||
|
|
||||||
private long cityId = NO_VALUE;
|
private long cityId = NO_VALUE;
|
||||||
|
@ -156,7 +156,8 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
|
||||||
String articleTitle = article.getImageTitle();
|
String articleTitle = article.getImageTitle();
|
||||||
if (!TextUtils.isEmpty(articleTitle)) {
|
if (!TextUtils.isEmpty(articleTitle)) {
|
||||||
String url = WikivoyageArticle.getImageUrl(articleTitle);
|
String url = WikivoyageArticle.getImageUrl(articleTitle);
|
||||||
sb.append("<img class=\"title-image\" src=\"").append(url).append("\"/>");
|
// sb.append("<img class=\"title-image\" src=\"").append(url).append("\"/>");
|
||||||
|
sb.append("<div class=\"title-image\" style=\"background-image: url(").append(url).append(")\"></div>");
|
||||||
}
|
}
|
||||||
sb.append("<div class=\"main\">\n");
|
sb.append("<div class=\"main\">\n");
|
||||||
sb.append("<h1>").append(article.getTitle()).append("</h1>");
|
sb.append("<h1>").append(article.getTitle()).append("</h1>");
|
||||||
|
|
Loading…
Reference in a new issue