diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 7ede5d47e..2100ea9ec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -366,7 +366,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun updatePagerItems(media: MutableList) { - val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, media, view_pager) + val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, media) if (!isDestroyed) { view_pager.apply { adapter = pagerAdapter diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt index a2531c2b5..dad510f72 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MyPagerAdapter.kt @@ -7,7 +7,6 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentStatePagerAdapter import androidx.viewpager.widget.PagerAdapter -import com.simplemobiletools.commons.views.MyViewPager import com.simplemobiletools.gallery.pro.activities.ViewPagerActivity import com.simplemobiletools.gallery.pro.fragments.PhotoFragment import com.simplemobiletools.gallery.pro.fragments.VideoFragment @@ -15,7 +14,7 @@ import com.simplemobiletools.gallery.pro.fragments.ViewPagerFragment import com.simplemobiletools.gallery.pro.helpers.MEDIUM import com.simplemobiletools.gallery.pro.models.Medium -class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val media: MutableList, val viewPager: MyViewPager) : FragmentStatePagerAdapter(fm) { +class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val media: MutableList) : FragmentStatePagerAdapter(fm) { private val fragments = HashMap() override fun getCount() = media.size @@ -29,10 +28,6 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m PhotoFragment() } - if (!medium.isVideo()) { - (fragment as? PhotoFragment)?.mViewPager = viewPager - } - fragment.arguments = bundle fragment.listener = activity return fragment diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index 4bde3bd59..88d5de466 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -30,7 +30,6 @@ import com.davemorrissey.labs.subscaleview.decoder.ImageDecoder import com.davemorrissey.labs.subscaleview.decoder.ImageRegionDecoder import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.OTG_PATH -import com.simplemobiletools.commons.views.MyViewPager import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.activities.PanoramaPhotoActivity import com.simplemobiletools.gallery.pro.activities.PhotoActivity @@ -80,7 +79,6 @@ class PhotoFragment : ViewPagerFragment() { private var mStoredShowHighestQuality = false private var mStoredAllowOneFingerZoom = false private var mStoredExtendedDetails = 0 - var mViewPager: MyViewPager? = null private lateinit var mView: ViewGroup private lateinit var mMedium: Medium @@ -383,9 +381,6 @@ class PhotoFragment : ViewPagerFragment() { mView.gestures_view.controller.apply { settings.maxZoom = 3f settings.overzoomFactor = 1.2f - if (mViewPager != null) { - enableScrollInViewPager(mViewPager) - } } }