mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
Merge pull request #2473 from KryptKode/fix/delete_position_in_view_pager
fix: position returning to 0
This commit is contained in:
commit
734ee5c6d8
1 changed files with 9 additions and 5 deletions
|
@ -1140,6 +1140,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (media.size == 1) {
|
||||||
|
onPageSelected(0)
|
||||||
|
}
|
||||||
|
|
||||||
movePathsInRecycleBin(arrayListOf(path)) {
|
movePathsInRecycleBin(arrayListOf(path)) {
|
||||||
if (it) {
|
if (it) {
|
||||||
tryDeleteFileDirItem(fileDirItem, false, false) {
|
tryDeleteFileDirItem(fileDirItem, false, false) {
|
||||||
|
@ -1173,6 +1177,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (media.size == 1) {
|
||||||
|
onPageSelected(0)
|
||||||
|
}
|
||||||
|
|
||||||
tryDeleteFileDirItem(fileDirItem, false, true) {
|
tryDeleteFileDirItem(fileDirItem, false, true) {
|
||||||
mIgnoredPaths.remove(fileDirItem.path)
|
mIgnoredPaths.remove(fileDirItem.path)
|
||||||
if (media.isEmpty()) {
|
if (media.isEmpty()) {
|
||||||
|
@ -1413,11 +1421,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
private fun getCurrentPath() = getCurrentMedium()?.path ?: ""
|
private fun getCurrentPath() = getCurrentMedium()?.path ?: ""
|
||||||
|
|
||||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
||||||
if (position == 0) {
|
|
||||||
onPageSelected(0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
if (mPos != position) {
|
if (mPos != position) {
|
||||||
|
|
Loading…
Reference in a new issue