add an option to hide content previews in headlines list (closes #606)

This commit is contained in:
Andrew Dolgov 2013-03-21 10:03:50 +04:00
parent b76380a388
commit 7358405040
4 changed files with 22 additions and 10 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="145"
android:versionName="1.22" >
android:versionCode="146"
android:versionName="1.23" >
<uses-sdk
android:minSdkVersion="8"

View File

@ -158,4 +158,6 @@
<string name="theme_dark_gray">Dark gray</string>
<string name="offline_articles_to_download">Number of articles to download</string>
<string name="offline_articles_to_download_long">Number of articles to download for Offlinemode. (newest first)</string>
<string name="pref_headlines_show_content_long">Show content previews in headlines list</string>
<string name="pref_headlines_show_content">Preview article content</string>
</resources>

View File

@ -86,6 +86,12 @@
android:key="default_view_mode"
android:summary="@string/pref_default_view_mode_long"
android:title="@string/pref_default_view_mode" />
<CheckBoxPreference
android:defaultValue="true"
android:key="headlines_show_content"
android:summary="@string/pref_headlines_show_content_long"
android:title="@string/pref_headlines_show_content" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/reading" >
<ListPreference
@ -140,4 +146,4 @@
android:title="@string/transport_debugging" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceScreen>

View File

@ -650,14 +650,18 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
String articleContent = article.content != null ? article.content : "";
if (te != null) {
String excerpt = Jsoup.parse(articleContent).text();
if (excerpt.length() > 200)
excerpt = excerpt.substring(0, 200) + "...";
te.setText(excerpt);
if (!m_prefs.getBoolean("headlines_show_content", true)) {
te.setVisibility(View.GONE);
} else {
String excerpt = Jsoup.parse(articleContent).text();
if (excerpt.length() > 200)
excerpt = excerpt.substring(0, 200) + "...";
te.setText(excerpt);
}
}
/* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator);
if (separator != null && m_onlineServices.isSmallScreen()) {