From 5a959002532798ee153b6621e0fe3a23e99b41be Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 26 Aug 2013 12:56:06 +0400 Subject: [PATCH] scroll to listview top when refreshing headlines (closes #767) --- src/org/fox/ttrss/HeadlinesFragment.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 42d960bc..63929fa1 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -371,6 +371,15 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, append = false; } + // new stuff may appear on top, scroll back to show it + if (!append) { + if (getView() != null) { + Log.d(TAG, "scroll hack"); + ListView list = (ListView)getView().findViewById(R.id.headlines); + list.smoothScrollToPosition(0); + } + } + final boolean fappend = append; final String sessionId = m_activity.getSessionId(); final boolean isCat = m_feed.is_cat;