From 4c9cef04f4ce10999762070f98af6bc5fef9b8fa Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 20 Oct 2018 16:12:20 +0200 Subject: [PATCH] fix slideshow swiping direction --- .../gallery/activities/ViewPagerActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 03cd4a0fa..444097363 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -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()