scroll to listview top when refreshing headlines (closes #767)

This commit is contained in:
Andrew Dolgov 2013-08-26 12:56:06 +04:00
parent 84cfc9a9fe
commit 5a95900253

View File

@ -371,6 +371,15 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
append = false; 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 boolean fappend = append;
final String sessionId = m_activity.getSessionId(); final String sessionId = m_activity.getSessionId();
final boolean isCat = m_feed.is_cat; final boolean isCat = m_feed.is_cat;