properly add headlines into articlepager in background while in portrait

mode
This commit is contained in:
Andrew Dolgov 2012-12-09 15:06:03 +04:00
parent 4a6c010125
commit 09d319bebd

View File

@ -97,6 +97,8 @@ public class ArticlePager extends Fragment {
m_listener.onArticleSelected(m_article, false); m_listener.onArticleSelected(m_article, false);
m_activity.setProgressBarVisibility(true);
pager.setAdapter(m_adapter); pager.setAdapter(m_adapter);
pager.setCurrentItem(position); pager.setCurrentItem(position);
pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@ -125,7 +127,7 @@ public class ArticlePager extends Fragment {
//Log.d(TAG, "Page #" + position + "/" + m_adapter.getCount()); //Log.d(TAG, "Page #" + position + "/" + m_adapter.getCount());
if (m_activity.isSmallScreen() && position == m_adapter.getCount() - 5) { if ((m_activity.isSmallScreen() || m_activity.isPortrait()) && position == m_adapter.getCount() - 5) {
Log.d(TAG, "loading more articles..."); Log.d(TAG, "loading more articles...");
refresh(true); refresh(true);
} }