fix #1537, fixing a glitch at opening Favorite videos

This commit is contained in:
tibbi 2019-08-10 21:34:58 +02:00
parent f43784e90a
commit 2de3e9abc4
4 changed files with 7 additions and 4 deletions

View file

@ -62,7 +62,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.15.31' implementation 'com.simplemobiletools:commons:5.15.33'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -835,7 +835,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
} else { } else {
val isVideo = path.isVideoFast() val isVideo = path.isVideoFast()
if (isVideo) { if (isVideo) {
openPath(path, false) val extras = HashMap<String, Boolean>()
extras[SHOW_FAVORITES] = mPath == FAVORITES
openPath(path, false, extras)
} else { } else {
Intent(this, ViewPagerActivity::class.java).apply { Intent(this, ViewPagerActivity::class.java).apply {
putExtra(PATH, path) putExtra(PATH, path)

View file

@ -229,6 +229,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
private fun sendViewPagerIntent(path: String) { private fun sendViewPagerIntent(path: String) {
Intent(this, ViewPagerActivity::class.java).apply { Intent(this, ViewPagerActivity::class.java).apply {
putExtra(SHOW_FAVORITES, intent.getBooleanExtra(SHOW_FAVORITES, false))
putExtra(IS_VIEW_INTENT, true) putExtra(IS_VIEW_INTENT, true)
putExtra(IS_FROM_GALLERY, mIsFromGallery) putExtra(IS_FROM_GALLERY, mIsFromGallery)
putExtra(PATH, path) putExtra(PATH, path)

View file

@ -60,8 +60,8 @@ fun Activity.setAs(path: String) {
setAsIntent(path, BuildConfig.APPLICATION_ID) setAsIntent(path, BuildConfig.APPLICATION_ID)
} }
fun Activity.openPath(path: String, forceChooser: Boolean) { fun Activity.openPath(path: String, forceChooser: Boolean, extras: HashMap<String, Boolean> = HashMap()) {
openPathIntent(path, forceChooser, BuildConfig.APPLICATION_ID) openPathIntent(path, forceChooser, BuildConfig.APPLICATION_ID, extras = extras)
} }
fun Activity.openEditor(path: String, forceChooser: Boolean = false) { fun Activity.openEditor(path: String, forceChooser: Boolean = false) {