diff options
author | David-Development <david-dev@live.de> | 2020-11-19 19:10:35 +0300 |
---|---|---|
committer | David Luhmer <david-dev@live.de> | 2020-11-19 19:10:35 +0300 |
commit | 9b74fe121a85f39323a7f4aa02c2c8016a544bed (patch) | |
tree | 466d21e9d40b822cbb0d809d5538542cfe2abdb8 /News-Android-App/src/main/java/de/luhmer | |
parent | e7a831f47d1bc0bbc5df3484fd68f299fffab927 (diff) |
adjust layout of detail view - fix #897
Signed-off-by: David Luhmer <david-dev@live.de>
Diffstat (limited to 'News-Android-App/src/main/java/de/luhmer')
-rw-r--r-- | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java index 40b74efa..a5122931 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java @@ -173,21 +173,24 @@ public class RssItemToHtmlTask extends AsyncTask<Void, Void, String> { builder.append("<div id=\"top_section\">"); builder.append(String.format("<div id=\"header\" class=\"%s\">", body_id)); - String feedTitle = Html.escapeHtml(rssItem.getTitle()); + String itemTitle = Html.escapeHtml(rssItem.getTitle()); String linkToFeed = Html.escapeHtml(rssItem.getLink()); - builder.append(String.format("<a href=\"%s\">%s</a>", linkToFeed, feedTitle)); + builder.append(String.format("<a href=\"%s\">%s</a>", linkToFeed, itemTitle)); builder.append("</div>"); - String authorOfArticle = Html.escapeHtml(rssItem.getAuthor()); - if (!"".equals(authorOfArticle)) { // If author is not empty, append him/her - feedTitle += " - " + authorOfArticle.trim(); + String authorLine = Html.escapeHtml(rssItem.getAuthor()); + if ("".equals(authorLine)) { // If author is empty, use name of feed instead + Feed feed = rssItem.getFeed(); + if (feed != null) { + authorLine = feed.getFeedTitle(); + } } builder.append("<div id=\"header_small_text\">"); builder.append("<div id=\"subscription\">"); builder.append(String.format("<img id=\"imgFavicon\" src=\"%s\" />", favIconUrl)); - builder.append(feedTitle.trim()); + builder.append(authorLine.trim()); builder.append("</div>"); Date date = rssItem.getPubDate(); |