mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
fix opening videos in the recycle bin directly
This commit is contained in:
parent
3e3fb0c580
commit
a1589b60f1
3 changed files with 6 additions and 5 deletions
|
@ -810,6 +810,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
|||
if (isVideo) {
|
||||
val extras = HashMap<String, Boolean>()
|
||||
extras[SHOW_FAVORITES] = mPath == FAVORITES
|
||||
if (path.startsWith(recycleBinPath)) {
|
||||
extras[IS_IN_RECYCLE_BIN] = true
|
||||
}
|
||||
|
||||
if (shouldSkipAuthentication()) {
|
||||
extras[SKIP_AUTHENTICATION] = true
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue