mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-03-03 19:18:46 +01:00
Merge pull request #2469 from KryptKode/fix/delete_position_in_view_pager
fix: position returning to 0
This commit is contained in:
commit
bbb806a5e6
@ -1136,7 +1136,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<Medium>
|
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<Medium>
|
||||||
if (media.isNotEmpty()) {
|
if (media.isNotEmpty()) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
refreshUI(media, true)
|
refreshUI(media, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1169,7 +1169,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<Medium>
|
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<Medium>
|
||||||
if (media.isNotEmpty()) {
|
if (media.isNotEmpty()) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
refreshUI(media, true)
|
refreshUI(media, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1413,7 +1413,11 @@ 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…
x
Reference in New Issue
Block a user