add offline_sort_by_feed

This commit is contained in:
Andrew Dolgov 2017-05-30 16:52:35 +03:00
parent b096bd3389
commit efbcbe7b89
4 changed files with 17 additions and 3 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="422"
android:versionName="1.188" >
android:versionCode="423"
android:versionName="1.189" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

View File

@ -116,6 +116,10 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
menu.findItem(R.id.article_set_note).setVisible(false);
menu.findItem(R.id.headlines_article_unread).setVisible(false); // TODO: implement
if (m_prefs.getBoolean("offline_sort_by_feed", false)) {
menu.findItem(R.id.catchup_above).setVisible(false);
}
super.onCreateContextMenu(menu, v, menuInfo);
}
@ -361,7 +365,11 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
}
String orderBy = (m_prefs.getBoolean("offline_oldest_first", false)) ? "updated" : "updated DESC";
if (m_prefs.getBoolean("offline_sort_by_feed", false)) {
orderBy = "feed_title, " + orderBy;
}
if (m_searchQuery == null || m_searchQuery.equals("")) {
return m_activity.getDatabase().query("articles LEFT JOIN feeds ON (feed_id = feeds."+BaseColumns._ID+")",
new String[] { "articles.*", "feeds.title AS feed_title" }, feedClause,

View File

@ -254,4 +254,5 @@
<string name="widget_background_transparent">Transparent</string>
<string name="pref_widget_background">Background color</string>
<string name="pref_widget_update_interval_summary">This interval is imprecise due to Android limitations</string>
<string name="prefs_offline_sort_by_feed">Group headlines by feeds</string>
</resources>

View File

@ -182,6 +182,11 @@
android:summary="@string/offline_articles_to_download_long"
android:title="@string/offline_articles_to_download" />
<org.fox.ttrss.util.LessBrokenSwitchPreference
android:defaultValue="false"
android:key="offline_sort_by_feed"
android:title="@string/prefs_offline_sort_by_feed" />
<org.fox.ttrss.util.LessBrokenSwitchPreference
android:defaultValue="false"
android:key="offline_image_cache_enabled"