fix slideshow swiping direction

This commit is contained in:
tibbi 2018-10-20 16:12:20 +02:00
parent b11ae1f319
commit 4c9cef04f4

View file

@ -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()