diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index ac7a269e8..d50c91cff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -810,6 +810,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (isVideo) { val extras = HashMap() extras[SHOW_FAVORITES] = mPath == FAVORITES + if (path.startsWith(recycleBinPath)) { + extras[IS_IN_RECYCLE_BIN] = true + } if (shouldSkipAuthentication()) { extras[SKIP_AUTHENTICATION] = true 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 9d7f59908..1841650c0 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 @@ -11,10 +11,7 @@ import android.view.MenuItem import android.view.View import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY -import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE -import com.simplemobiletools.commons.helpers.REAL_FILE_PATH -import com.simplemobiletools.commons.helpers.isRPlus +import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.pro.BuildConfig import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.* @@ -81,7 +78,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList mUri = intent.data ?: return val uri = mUri.toString() - if (uri.startsWith("content:/") && uri.contains("/storage/")) { + if (uri.startsWith("content:/") && uri.contains("/storage/") && !intent.getBooleanExtra(IS_IN_RECYCLE_BIN, false)) { val guessedPath = uri.substring(uri.indexOf("/storage/")) if (getDoesFilePathExist(guessedPath)) { val extras = intent.extras ?: Bundle() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt index a214d7a93..59c5eb70a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt @@ -112,6 +112,7 @@ const val SLIDESHOW_ANIMATION_FADE = 2 const val RECYCLE_BIN = "recycle_bin" const val SHOW_FAVORITES = "show_favorites" const val SHOW_RECYCLE_BIN = "show_recycle_bin" +const val IS_IN_RECYCLE_BIN = "is_in_recycle_bin" const val SHOW_NEXT_ITEM = "show_next_item" const val SHOW_PREV_ITEM = "show_prev_item" const val GO_TO_NEXT_ITEM = "go_to_next_item"