diff options
Diffstat (limited to 'src/org/fox/ttrss/HeadlinesFragment.java')
| -rw-r--r-- | src/org/fox/ttrss/HeadlinesFragment.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 11baf482..231a66d6 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -658,6 +658,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, final Article article = items.get(position); + int headlineFontSize = Integer.parseInt(m_prefs.getString("headlines_font_size_sp", "13")); + int headlineSmallFontSize = Math.max(10, Math.min(18, headlineFontSize - 2)); + if (v == null) { int layoutId = R.layout.headlines_row; @@ -686,19 +689,21 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, TextView tt = (TextView)v.findViewById(R.id.title); if (tt != null) { + tt.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3)); tt.setText(Html.fromHtml(article.title)); adjustTitleTextView(article.score, tt, position); } TextView ft = (TextView)v.findViewById(R.id.feed_title); - if (ft != null) { + if (ft != null) { if (article.feed_title != null && (m_feed.is_cat || m_feed.id < 0)) { /* if (article.feed_title.length() > 20) ft.setText(article.feed_title.substring(0, 20) + "..."); else */ + ft.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineSmallFontSize); ft.setText(article.feed_title); } else { @@ -754,7 +759,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE) excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "..."; - te.setTextSize(TypedValue.COMPLEX_UNIT_SP, Integer.parseInt(m_prefs.getString("headlines_font_size_sp", "13"))); + te.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize); te.setText(excerpt); } } @@ -763,12 +768,15 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, TextView author = (TextView)v.findViewById(R.id.author); - if (author != null) + if (author != null) { + author.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineSmallFontSize); + if (articleAuthor.length() > 0) { author.setText(getString(R.string.author_formatted, articleAuthor)); } else { author.setText(""); } + } /* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator); @@ -779,6 +787,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, TextView dv = (TextView) v.findViewById(R.id.date); if (dv != null) { + dv.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineSmallFontSize); + Date d = new Date((long)article.updated * 1000); DateFormat df = new SimpleDateFormat("MMM dd, HH:mm"); df.setTimeZone(TimeZone.getDefault()); |