From fb86971ca88b47d24f83de1f2d495ba8b1815a44 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 24 Nov 2011 15:16:07 +0300 Subject: [PATCH] mark articles as read when reading --- res/layout/main.xml | 10 +++++----- src/org/fox/ttrss/HeadlinesFragment.java | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/res/layout/main.xml b/res/layout/main.xml index da5de56f..97a9e9c8 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,17 +1,17 @@ - - - - - + + + + + \ No newline at end of file diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 953bed54..d2c019ad 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -108,6 +108,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { article.unread = false; m_selectedArticleId = article.id; m_adapter.notifyDataSetChanged(); + + catchupArticle(article); } } @@ -206,6 +208,23 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { } } + public void catchupArticle(final Article article) { + ApiRequest ar = new ApiRequest(); + ar.setApi(m_prefs.getString("ttrss_url", null)); + + HashMap map = new HashMap() { + { + put("sid", m_sessionId); + put("op", "updateArticle"); + put("article_ids", String.valueOf(article.id)); + put("mode", "0"); + put("field", "2"); + } + }; + + ar.execute(map); + } + private class ArticleListAdapter extends ArrayAdapter
{ private ArrayList
items;