Merge pull request #2469 from KryptKode/fix/delete_position_in_view_pager
fix: position returning to 0
This commit is contained in:
commit
bbb806a5e6
1 changed files with 7 additions and 3 deletions
|
@ -1136,7 +1136,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<Medium>
|
||||
if (media.isNotEmpty()) {
|
||||
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>
|
||||
if (media.isNotEmpty()) {
|
||||
runOnUiThread {
|
||||
refreshUI(media, true)
|
||||
refreshUI(media, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1413,7 +1413,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
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) {
|
||||
if (mPos != position) {
|
||||
|
|
Loading…
Reference in a new issue