diff options
author | Andrew Dolgov <[email protected]> | 2017-10-31 21:32:50 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-10-31 21:33:23 +0300 |
commit | 0ab4fe136ef6cfddd496eb86d01de39c962e6dc0 (patch) | |
tree | bfaf4252fc88fce9ac5c0fd24886692579ddd974 /org.fox.ttrss/src/main | |
parent | b28ba0430bb3376587e4645add65a30524dc0389 (diff) |
offline article menu: implement toggle unread
Diffstat (limited to 'org.fox.ttrss/src/main')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index 323d9546..39d9501b 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -134,7 +134,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis menu.findItem(R.id.set_labels).setVisible(false); 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); @@ -158,6 +157,20 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis private boolean onArticleMenuItemSelected(MenuItem item, final int articleId) { switch (item.getItemId()) { + case R.id.headlines_article_unread: + if (true) { + + SQLiteStatement stmt = m_activity.getDatabase().compileStatement( + "UPDATE articles SET modified = 1, unread = not unread " + "WHERE " + BaseColumns._ID + + " = ?"); + + stmt.bindLong(1, articleId); + stmt.execute(); + stmt.close(); + + refresh(); + } + return true; case R.id.headlines_article_link_copy: if (true) { Cursor article = m_activity.getArticleById(articleId); @@ -972,7 +985,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis popup.getMenu().findItem(R.id.set_labels).setVisible(false); popup.getMenu().findItem(R.id.article_set_note).setVisible(false); - popup.getMenu().findItem(R.id.headlines_article_unread).setVisible(false); // TODO: implement popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override |