From c444d3b1e6a69665d2750e15b5eea7f423176663 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Oct 2012 16:45:33 +0400 Subject: [PATCH] support server always_display_attachments article: properly serialize new fields --- src/org/fox/ttrss/ArticleFragment.java | 15 +++++++++------ src/org/fox/ttrss/types/Article.java | 8 ++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 6da3133a..399f0f10 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -262,16 +262,19 @@ public class ArticleFragment extends Fragment { spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + String flatContent = articleContent.replaceAll("[\r\n]", ""); + boolean hasImages = flatContent.matches(".*?+].*?"); + for (Attachment a : m_article.attachments) { if (a.content_type != null && a.content_url != null) { try { - URL url = new URL(a.content_url.trim()); - String strUrl = url.toString().trim(); - - String regex = String.format(".*?

"; } diff --git a/src/org/fox/ttrss/types/Article.java b/src/org/fox/ttrss/types/Article.java index 6db4b938..8e619b4b 100644 --- a/src/org/fox/ttrss/types/Article.java +++ b/src/org/fox/ttrss/types/Article.java @@ -24,6 +24,7 @@ public class Article implements Parcelable { public String feed_title; public int comments_count; public String comments_link; + public boolean always_display_attachments; public Article(Parcel in) { readFromParcel(in); @@ -60,6 +61,9 @@ public class Article implements Parcelable { out.writeString(content); out.writeList(attachments); out.writeString(feed_title); + out.writeInt(comments_count); + out.writeString(comments_link); + out.writeInt(always_display_attachments ? 1 : 0); } public void readFromParcel(Parcel in) { @@ -82,6 +86,10 @@ public class Article implements Parcelable { in.readList(attachments, Attachment.class.getClassLoader()); feed_title = in.readString(); + + comments_count = in.readInt(); + comments_link = in.readString(); + always_display_attachments = in.readInt() == 1; } @SuppressWarnings("rawtypes")