mark read on scroll: don't forget the last item

This commit is contained in:
Andrew Dolgov 2017-06-01 18:07:32 +03:00
parent 583578fe8a
commit 6b769ff610

View File

@ -416,7 +416,7 @@ public class HeadlinesFragment extends Fragment {
if (m_prefs.getBoolean("headlines_mark_read_scroll", false) && firstVisibleItem > m_adapter.getHeaderCount()) { if (m_prefs.getBoolean("headlines_mark_read_scroll", false) && firstVisibleItem > m_adapter.getHeaderCount()) {
if (firstVisibleItem <= m_articles.size()) { if (firstVisibleItem <= m_articles.size() + m_adapter.getHeaderCount()) {
Article a = (Article) m_articles.get(firstVisibleItem - m_adapter.getHeaderCount() - 1); Article a = (Article) m_articles.get(firstVisibleItem - m_adapter.getHeaderCount() - 1);