diff options
author | Andrew Dolgov <[email protected]> | 2013-11-16 00:32:24 -0800 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-11-16 00:32:24 -0800 |
commit | 8145f16e452c15cda0912d7e98c10513be4f5862 (patch) | |
tree | c3509ae44743f6c3e6f7e366ebbd23a0ee7c8928 | |
parent | 1d3d10ad09ffe97d02869f00ff2516ddbb9549fe (diff) | |
parent | e17e6fc7a8e62bb0dbf836e29f02495dc1dcccb4 (diff) |
Merge pull request #57 from moneytoo/offline-preview
respect preview article content option in offline mode
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index 50c861ca..72892081 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -561,27 +561,31 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis TextView te = (TextView)v.findViewById(R.id.excerpt); if (te != null) { - String excerpt = Jsoup.parse(article.getString(article.getColumnIndex("content"))).text(); - - if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE) - excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "..."; - - int fontSize = -1; - - switch (Integer.parseInt(m_prefs.getString("headlines_font_size", "0"))) { - case 0: - fontSize = 13; - break; - case 1: - fontSize = 16; - break; - case 2: - fontSize = 18; - break; + if (!m_prefs.getBoolean("headlines_show_content", true)) { + te.setVisibility(View.GONE); + } else { + String excerpt = Jsoup.parse(article.getString(article.getColumnIndex("content"))).text(); + + if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE) + excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "..."; + + int fontSize = -1; + + switch (Integer.parseInt(m_prefs.getString("headlines_font_size", "0"))) { + case 0: + fontSize = 13; + break; + case 1: + fontSize = 16; + break; + case 2: + fontSize = 18; + break; + } + + te.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + te.setText(excerpt); } - - te.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); - te.setText(excerpt); } TextView ta = (TextView)v.findViewById(R.id.author); |