From 5b0c674f2bba0c0e5a7fc016b7a003d133d0cd0e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 26 Nov 2011 10:40:35 +0300 Subject: [PATCH] scroll to the first new entry when loading more headlines --- src/org/fox/ttrss/HeadlinesFragment.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index f3790ec9..f8159dad 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -191,11 +191,19 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { if (m_offset == 0) m_articles.clear(); + int last_position = m_articles.size(); + for (Article f : articles) m_articles.add(f); m_adapter.notifyDataSetChanged(); + ListView list = (ListView)getView().findViewById(R.id.headlines); + + if (list != null) { + list.setSelection(last_position+1); + } + showLoading(false); } });