From 5ca662103bb2ee6a05d3194c66d49fbb216c352b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Apr 2020 15:30:43 +0200 Subject: [PATCH] removing the folder locking check from a few places to avoid duplication --- .../pro/activities/PhotoVideoActivity.kt | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt index 50600c6b0..0c2112df0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt @@ -103,12 +103,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList if (realPath.getFilenameFromPath().contains('.') || filename.contains('.')) { if (isFileTypeVisible(realPath)) { bottom_actions.beGone() - handleLockedFolderOpening(realPath.getParentPath()) { success -> - if (success) { - sendViewPagerIntent(realPath) - } - finish() - } + sendViewPagerIntent(realPath) + finish() return } } else { @@ -120,13 +116,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList if (mUri!!.scheme == "file") { if (filename.contains('.')) { bottom_actions.beGone() - handleLockedFolderOpening(mUri!!.path!!.getParentPath()) { success -> - if (success) { - rescanPaths(arrayListOf(mUri!!.path!!)) - sendViewPagerIntent(mUri!!.path!!) - } - finish() - } + rescanPaths(arrayListOf(mUri!!.path!!)) + sendViewPagerIntent(mUri!!.path!!) + finish() } return } else { @@ -134,13 +126,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && filename.contains('.') && getDoesFilePathExist(path)) { if (isFileTypeVisible(path)) { bottom_actions.beGone() - handleLockedFolderOpening(path.getParentPath()) { success -> - if (success) { - rescanPaths(arrayListOf(mUri!!.path!!)) - sendViewPagerIntent(path) - } - finish() - } + rescanPaths(arrayListOf(mUri!!.path!!)) + sendViewPagerIntent(path) + finish() return } }