mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
handle onPageSelected called twice on every page change
This commit is contained in:
@ -860,12 +860,15 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||||||
if (view_pager.offscreenPageLimit == 1) {
|
if (view_pager.offscreenPageLimit == 1) {
|
||||||
view_pager.offscreenPageLimit = 2
|
view_pager.offscreenPageLimit = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mPos != position) {
|
||||||
mPos = position
|
mPos = position
|
||||||
updateActionbarTitle()
|
updateActionbarTitle()
|
||||||
mRotationDegrees = 0f
|
mRotationDegrees = 0f
|
||||||
supportInvalidateOptionsMenu()
|
supportInvalidateOptionsMenu()
|
||||||
scheduleSwipe()
|
scheduleSwipe()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onPageScrollStateChanged(state: Int) {
|
override fun onPageScrollStateChanged(state: Int) {
|
||||||
if (state == ViewPager.SCROLL_STATE_IDLE && getCurrentMedium() != null) {
|
if (state == ViewPager.SCROLL_STATE_IDLE && getCurrentMedium() != null) {
|
||||||
|
Reference in New Issue
Block a user