From 8a97531a5a1d2e013db08b7fbef0eb2cd10baaf9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 24 Jan 2014 13:41:37 +0400 Subject: tweak typography and layouts a bit --- .../fox/ttrss/offline/OfflineArticleFragment.java | 35 +++++++++++++++------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src/org/fox/ttrss/offline') 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; -- cgit v1.2.3-54-g00ecf