From 98cd1762e5208be31e5fa8ff9b27def40512f41d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Dec 2011 08:32:17 +0300 Subject: add mark above as read to article menu --- src/org/fox/ttrss/MainActivity.java | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 7a11373c..ebdf62d5 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -674,6 +674,24 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe updateHeadlines(); } return true; + case R.id.catchup_above: + if (hf != null) { + if (m_selectedArticle != null) { + ArticleList articles = hf.getAllArticles(); + ArticleList tmp = new ArticleList(); + for (Article a : articles) { + a.unread = false; + tmp.add(a); + if (m_selectedArticle.id == a.id) + break; + } + if (tmp.size() > 0) { + toggleArticlesUnread(tmp); + hf.notifyUpdated(); + } + } + } + return true; case R.id.set_unread: if (m_selectedArticle != null) { m_selectedArticle.unread = true; @@ -1258,8 +1276,18 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe if (hf != null) { Article article = hf.getArticleAtPosition(info.position); if (article != null) { - // TODO implement - + ArticleList articles = hf.getAllArticles(); + ArticleList tmp = new ArticleList(); + for (Article a : articles) { + a.unread = false; + tmp.add(a); + if (article.id == a.id) + break; + } + if (tmp.size() > 0) { + toggleArticlesUnread(tmp); + hf.notifyUpdated(); + } } } return true; -- cgit v1.2.3