mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
backout 9ee8634f70dc because it didn't work
This commit is contained in:
parent
bb71a45a59
commit
a7779868e8
@ -40,6 +40,7 @@ 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;
|
||||
@ -123,7 +124,8 @@ public class HomePager extends ViewPager {
|
||||
setFocusableInTouchMode(true);
|
||||
|
||||
mOriginalBackground = getBackground();
|
||||
setOnPageChangeListener(new PageChangeListener());
|
||||
mPageChangeListener = new PageChangeListener();
|
||||
setOnPageChangeListener(mPageChangeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -216,10 +218,9 @@ public class HomePager extends ViewPager {
|
||||
public void setCurrentItem(int item, boolean smoothScroll) {
|
||||
super.setCurrentItem(item, smoothScroll);
|
||||
|
||||
// Android doesn't call onPageSelected when there is only one page. Make sure we activate
|
||||
// the banner in this case.
|
||||
if (mHomeBanner != null && getAdapter().getCount() == 1) {
|
||||
mHomeBanner.setActive(true);
|
||||
// Android doesn't call this when there is only one item
|
||||
if (getAdapter().getCount() == 1 && mPageChangeListener != null) {
|
||||
mPageChangeListener.onPageSelected(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user