diff options
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/fox/ttrss/ArticleFragment.java | 30 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineArticleFragment.java | 35 |
2 files changed, 44 insertions, 21 deletions
diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index d7791d83..96c119d9 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -333,12 +333,31 @@ public class ArticleFragment extends Fragment { DateFormat df = new SimpleDateFormat("MMM dd, HH:mm"); dv.setText(df.format(d)); } + + TextView author = (TextView)view.findViewById(R.id.author); + + boolean hasAuthor = false; + if (author != null) { + if (m_article.author != null && m_article.author.length() > 0) { + author.setText(getString(R.string.author_formatted, m_article.author)); + } else { + author.setVisibility(View.GONE); + } + hasAuthor = true; + } + TextView tagv = (TextView)view.findViewById(R.id.tags); if (tagv != null) { if (m_article.feed_title != null) { - tagv.setText(m_article.feed_title); + String fTitle = m_article.feed_title; + + if (!hasAuthor && m_article.author != null && m_article.author.length() > 0) { + fTitle += " (" + getString(R.string.author_formatted, m_article.author) + ")"; + } + + tagv.setText(fTitle); } else if (m_article.tags != null) { String tagsStr = ""; @@ -353,15 +372,6 @@ public class ArticleFragment extends Fragment { } } - TextView author = (TextView)view.findViewById(R.id.author); - - if (author != null) { - if (m_article.author != null && m_article.author.length() > 0) { - author.setText(getString(R.string.author_formatted, m_article.author)); - } else { - author.setVisibility(View.GONE); - } - } } return view; diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index a1033aec..de697006 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -327,29 +327,42 @@ public class OfflineArticleFragment extends Fragment { DateFormat df = new SimpleDateFormat("MMM dd, HH:mm"); dv.setText(df.format(d)); } + + TextView author = (TextView)view.findViewById(R.id.author); + + boolean hasAuthor = false; + if (author != null) { + int authorIndex = m_cursor.getColumnIndex("author"); + if (authorIndex >= 0) + author.setText(m_cursor.getString(authorIndex)); + else + author.setVisibility(View.GONE); + + hasAuthor = true; + } + TextView tagv = (TextView)view.findViewById(R.id.tags); if (tagv != null) { int feedTitleIndex = m_cursor.getColumnIndex("feed_title"); - if (feedTitleIndex != -1 && m_isCat) { - tagv.setText(m_cursor.getString(feedTitleIndex)); + if (feedTitleIndex != -1 /* && m_isCat */) { + String fTitle = m_cursor.getString(feedTitleIndex); + + int authorIndex = m_cursor.getColumnIndex("author"); + + if (!hasAuthor && authorIndex >= 0) { + fTitle += " (" + getString(R.string.author_formatted, m_cursor.getString(authorIndex)) + ")"; + } + + tagv.setText(fTitle); } else { String tagsStr = m_cursor.getString(m_cursor.getColumnIndex("tags")); tagv.setText(tagsStr); } } - TextView author = (TextView)view.findViewById(R.id.author); - - if (author != null) { - int authorIndex = m_cursor.getColumnIndex("author"); - if (authorIndex >= 0) - author.setText(m_cursor.getString(authorIndex)); - else - author.setVisibility(View.GONE); - } } return view; |