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 e63e41893..571f361f7 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 @@ -92,6 +92,8 @@ class PhotoFragment : ViewPagerFragment() { return mView } + mMedium = arguments!!.getSerializable(MEDIUM) as Medium + mView.apply { subsampling_view.setOnClickListener { photoClicked() } gestures_view.setOnClickListener { photoClicked() } @@ -149,7 +151,6 @@ class PhotoFragment : ViewPagerFragment() { mIsFragmentVisible = true } - mMedium = arguments!!.getSerializable(MEDIUM) as Medium if (mMedium.path.startsWith("content://") && !mMedium.path.startsWith("content://mms/")) { val originalPath = mMedium.path mMedium.path = context!!.getRealPathFromURI(Uri.parse(originalPath)) ?: mMedium.path diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 11f78f20a..fb6f9cde7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -74,6 +74,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private lateinit var mSeekBar: SeekBar override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + mMedium = arguments!!.getSerializable(MEDIUM) as Medium mConfig = context!!.config mView = inflater.inflate(R.layout.pager_video_item, container, false).apply { instant_prev_item.setOnClickListener { listener?.goToPrevItem() } @@ -122,7 +123,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } } - mMedium = arguments!!.getSerializable(MEDIUM) as Medium if (!arguments!!.getBoolean(SHOULD_INIT_FRAGMENT, true)) { return mView }