mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47: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
|
val dragOffset = dragPosition - oldDragPosition
|
||||||
oldDragPosition = dragPosition
|
oldDragPosition = dragPosition
|
||||||
try {
|
try {
|
||||||
view_pager.fakeDragBy(dragOffset * (if (forward) 1f else -1f))
|
view_pager.fakeDragBy(dragOffset * (if (forward) -1f else 1f))
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
stopSlideshow()
|
stopSlideshow()
|
||||||
}
|
}
|
||||||
|
@ -444,9 +444,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
private fun slideshowEnded(forward: Boolean) {
|
private fun slideshowEnded(forward: Boolean) {
|
||||||
if (config.loopSlideshow) {
|
if (config.loopSlideshow) {
|
||||||
if (forward) {
|
if (forward) {
|
||||||
view_pager.setCurrentItem(0, false)
|
|
||||||
} else {
|
|
||||||
view_pager.setCurrentItem(view_pager.adapter!!.count - 1, false)
|
view_pager.setCurrentItem(view_pager.adapter!!.count - 1, false)
|
||||||
|
} else {
|
||||||
|
view_pager.setCurrentItem(0, false)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stopSlideshow()
|
stopSlideshow()
|
||||||
|
|
Loading…
Reference in a new issue