diff options
author | David Development <david-dev@live.de> | 2016-04-24 17:44:16 +0300 |
---|---|---|
committer | David Development <david-dev@live.de> | 2016-04-24 17:44:16 +0300 |
commit | c9717a2bab1992427866dbdeb60db21f8a6405fe (patch) | |
tree | 3495d5626270c4cfdc6b3f36b19718d77248d190 /News-Android-App | |
parent | 2c4f83d12275699aafad0872e41c3de2eb17a8ac (diff) |
Refactoring (#517)
Diffstat (limited to 'News-Android-App')
-rw-r--r-- | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/ViewHolder.java | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/ViewHolder.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/ViewHolder.java index 024f75c6..1ed83d86 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/ViewHolder.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/ViewHolder.java @@ -192,7 +192,6 @@ public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickL public void setRssItem(RssItem rssItem) { this.rssItem = rssItem; String title = null; - String body = rssItem.getBody(); String favIconUrl = null; if(rssItem.getFeed() != null) { title = rssItem.getFeed().getFeedTitle(); @@ -206,21 +205,32 @@ public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickL setFeedColor(ColorHelper.getFeedColor(itemView.getContext(), rssItem.getFeed())); - if(textViewSummary != null) - textViewSummary.setText(Html.fromHtml(rssItem.getTitle()).toString()); + if(textViewSummary != null) { + try { + //byte[] arrByteForSpanish = rssItem.getTitle().getBytes("ISO-8859-1"); + //String spanish = new String(arrByteForSpanish);//.getBytes("UTF-8"); + //textViewSummary.setText(Html.fromHtml(spanish)); + + textViewSummary.setText(Html.fromHtml(rssItem.getTitle())); + } catch (Exception e) { + e.printStackTrace(); + } + } - if(textViewTitle != null) - textViewTitle.setText(title); + if(textViewTitle != null) { + textViewTitle.setText(Html.fromHtml(title)); + } if(textViewBody != null) { + String body = rssItem.getBody(); // Strip html from String - if(selectedListLayout == 3) { textViewBody.setMaxLines(200); - textViewBody.setText(getBodyText(body, false)); + body = getBodyText(body, false); } else { - textViewBody.setText(getBodyText(body, true)); + body = getBodyText(body, true); } + textViewBody.setText(Html.fromHtml(body)); } if(textViewItemDate != null) |