diff --git a/res/values/strings.xml b/res/values/strings.xml index bdcfa61d..6dd47839 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -193,4 +193,6 @@ Labels View Caption Light theme is not supported on Honeycomb + Mark read on scroll + Headlines will be marked read when scrolling past them diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 99ac42aa..e05fc5b6 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -92,13 +92,16 @@ android:key="headlines_show_content" android:summary="@string/pref_headlines_show_content_long" android:title="@string/pref_headlines_show_content" /> - - + + 0) { + Article a = m_articles.get(firstVisibleItem - 1); + + if (a != null && a.unread) { + a.unread = false; + m_readArticles.add(a); + m_feed.unread--; + } + } } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { - // no-op + if (scrollState == SCROLL_STATE_IDLE && m_prefs.getBoolean("headlines_mark_read_scroll", false)) { + if (!m_readArticles.isEmpty()) { + m_activity.toggleArticlesUnread(m_readArticles); + m_activity.refresh(false); + m_readArticles.clear(); + } + } } public Article getActiveArticle() {