diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 0c13f4134..358f1e1ca 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -214,7 +214,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) { view_pager.apply { - offscreenPageLimit = 2 adapter = pagerAdapter currentItem = mPos addOnPageChangeListener(this@ViewPagerActivity) @@ -503,6 +502,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } override fun onPageSelected(position: Int) { + if (view_pager.offscreenPageLimit == 1) { + view_pager.offscreenPageLimit = 2 + } mPos = position updateActionbarTitle() mRotationDegrees = 0f diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 875ef6e1a..5664ed1f8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -215,7 +215,6 @@ class PhotoFragment : ViewPagerFragment() { override fun onImageLoadError(e: Exception?) { background = ColorDrawable(Color.TRANSPARENT) - beGone() }