From cc33aee3eac81a7ed94729b20471919c60d5ffd6 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Wed, 5 Mar 2014 12:21:22 -0800 Subject: [PATCH] backout 4bc6027f5638 for causing bug 978741 --- mobile/android/base/home/HomePager.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mobile/android/base/home/HomePager.java b/mobile/android/base/home/HomePager.java index 6068da8db78..4038eaeea50 100644 --- a/mobile/android/base/home/HomePager.java +++ b/mobile/android/base/home/HomePager.java @@ -40,7 +40,6 @@ public class HomePager extends ViewPager { private HomeBanner mHomeBanner; private int mDefaultPageIndex = -1; - private final ViewPager.OnPageChangeListener mPageChangeListener; private final OnAddPanelListener mAddPanelListener; private final HomeConfig mConfig; @@ -124,8 +123,7 @@ public class HomePager extends ViewPager { setFocusableInTouchMode(true); mOriginalBackground = getBackground(); - mPageChangeListener = new PageChangeListener(); - setOnPageChangeListener(mPageChangeListener); + setOnPageChangeListener(new PageChangeListener()); } @Override @@ -218,9 +216,8 @@ public class HomePager extends ViewPager { public void setCurrentItem(int item, boolean smoothScroll) { super.setCurrentItem(item, smoothScroll); - // Android doesn't call this when there is only one item - if (getAdapter().getCount() == 1 && mPageChangeListener != null) { - mPageChangeListener.onPageSelected(0); + if (mDecor != null) { + mDecor.onPageSelected(item); } } @@ -264,10 +261,6 @@ public class HomePager extends ViewPager { mDecor.removeAllPagerViews(); } - if (mHomeBanner != null) { - mHomeBanner.setActive(false); - } - final HomeAdapter adapter = (HomeAdapter) getAdapter(); // Destroy any existing panels currently loaded