summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2014-01-24 13:41:37 +0400
committerAndrew Dolgov <[email protected]>2014-01-24 13:41:37 +0400
commit8a97531a5a1d2e013db08b7fbef0eb2cd10baaf9 (patch)
tree97dc743ac00a46be77d00d3bdebad4795a533ce7 /src
parente840ebbc96d080b0d0ef278ba74461dbd3b0a5c2 (diff)
tweak typography and layouts a bit
Diffstat (limited to 'src')
-rw-r--r--src/org/fox/ttrss/ArticleFragment.java30
-rw-r--r--src/org/fox/ttrss/offline/OfflineArticleFragment.java35
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;