mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
fix slideshow swiping direction
This commit is contained in:
parent
b11ae1f319
commit
4c9cef04f4
1 changed files with 3 additions and 3 deletions
|
@ -428,7 +428,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
val dragOffset = dragPosition - oldDragPosition
|
||||
oldDragPosition = dragPosition
|
||||
try {
|
||||
view_pager.fakeDragBy(dragOffset * (if (forward) 1f else -1f))
|
||||
view_pager.fakeDragBy(dragOffset * (if (forward) -1f else 1f))
|
||||
} catch (e: Exception) {
|
||||
stopSlideshow()
|
||||
}
|
||||
|
@ -444,9 +444,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
private fun slideshowEnded(forward: Boolean) {
|
||||
if (config.loopSlideshow) {
|
||||
if (forward) {
|
||||
view_pager.setCurrentItem(0, false)
|
||||
} else {
|
||||
view_pager.setCurrentItem(view_pager.adapter!!.count - 1, false)
|
||||
} else {
|
||||
view_pager.setCurrentItem(0, false)
|
||||
}
|
||||
} else {
|
||||
stopSlideshow()
|
||||
|
|
Loading…
Reference in a new issue