Merge pull request #57 from moneytoo/offline-preview

respect preview article content option in offline mode
This commit is contained in:
Andrew Dolgov 2013-11-16 00:32:24 -08:00
commit 8145f16e45

View File

@ -561,27 +561,31 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
TextView te = (TextView)v.findViewById(R.id.excerpt); TextView te = (TextView)v.findViewById(R.id.excerpt);
if (te != null) { if (te != null) {
String excerpt = Jsoup.parse(article.getString(article.getColumnIndex("content"))).text(); if (!m_prefs.getBoolean("headlines_show_content", true)) {
te.setVisibility(View.GONE);
if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE) } else {
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "..."; String excerpt = Jsoup.parse(article.getString(article.getColumnIndex("content"))).text();
int fontSize = -1; if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE)
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "...";
switch (Integer.parseInt(m_prefs.getString("headlines_font_size", "0"))) {
case 0: int fontSize = -1;
fontSize = 13;
break; switch (Integer.parseInt(m_prefs.getString("headlines_font_size", "0"))) {
case 1: case 0:
fontSize = 16; fontSize = 13;
break; break;
case 2: case 1:
fontSize = 18; fontSize = 16;
break; 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); TextView ta = (TextView)v.findViewById(R.id.author);