respect preview article content option in offline mode

This commit is contained in:
Marcel Dopita 2013-11-15 23:50:28 +01:00
parent 1d3d10ad09
commit e17e6fc7a8
1 changed files with 24 additions and 20 deletions

View File

@ -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);