handle onPageSelected called twice on every page change
This commit is contained in:
parent
9751daa8af
commit
8843a4a006
1 changed files with 8 additions and 5 deletions
|
@ -860,11 +860,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
if (view_pager.offscreenPageLimit == 1) {
|
||||
view_pager.offscreenPageLimit = 2
|
||||
}
|
||||
mPos = position
|
||||
updateActionbarTitle()
|
||||
mRotationDegrees = 0f
|
||||
supportInvalidateOptionsMenu()
|
||||
scheduleSwipe()
|
||||
|
||||
if (mPos != position) {
|
||||
mPos = position
|
||||
updateActionbarTitle()
|
||||
mRotationDegrees = 0f
|
||||
supportInvalidateOptionsMenu()
|
||||
scheduleSwipe()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
|
|
Loading…
Reference in a new issue