mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-25 07:51:26 +01:00
correcting a check at getting current medium at viewpager
This commit is contained in:
parent
e98de74ae4
commit
6dc1323252
@ -509,7 +509,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||
}
|
||||
|
||||
private fun getCurrentMedium(): Medium? {
|
||||
return if (mMedia.isEmpty() || mPos >= mMedia.size)
|
||||
return if (mMedia.isEmpty() || mPos == -1)
|
||||
null
|
||||
else
|
||||
mMedia[Math.min(mPos, mMedia.size - 1)]
|
||||
|
Loading…
Reference in New Issue
Block a user