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 {
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 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1'

View File

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

View File

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

View File

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