replace MEDIUM constant with PATH in some intents
This commit is contained in:
parent
d52eb60611
commit
b421dc273f
5 changed files with 8 additions and 6 deletions
|
@ -506,7 +506,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
openFile(Uri.fromFile(file), false)
|
openFile(Uri.fromFile(file), false)
|
||||||
} else {
|
} else {
|
||||||
Intent(this, ViewPagerActivity::class.java).apply {
|
Intent(this, ViewPagerActivity::class.java).apply {
|
||||||
putExtra(MEDIUM, path)
|
putExtra(PATH, path)
|
||||||
putExtra(SHOW_ALL, mShowAll)
|
putExtra(SHOW_ALL, mShowAll)
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import com.simplemobiletools.gallery.fragments.ViewPagerFragment
|
||||||
import com.simplemobiletools.gallery.helpers.IS_FROM_GALLERY
|
import com.simplemobiletools.gallery.helpers.IS_FROM_GALLERY
|
||||||
import com.simplemobiletools.gallery.helpers.IS_VIEW_INTENT
|
import com.simplemobiletools.gallery.helpers.IS_VIEW_INTENT
|
||||||
import com.simplemobiletools.gallery.helpers.MEDIUM
|
import com.simplemobiletools.gallery.helpers.MEDIUM
|
||||||
|
import com.simplemobiletools.gallery.helpers.PATH
|
||||||
import com.simplemobiletools.gallery.models.Medium
|
import com.simplemobiletools.gallery.models.Medium
|
||||||
import kotlinx.android.synthetic.main.fragment_holder.*
|
import kotlinx.android.synthetic.main.fragment_holder.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
@ -108,7 +109,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
Intent(this, ViewPagerActivity::class.java).apply {
|
Intent(this, ViewPagerActivity::class.java).apply {
|
||||||
putExtra(IS_VIEW_INTENT, true)
|
putExtra(IS_VIEW_INTENT, true)
|
||||||
putExtra(IS_FROM_GALLERY, mIsFromGallery)
|
putExtra(IS_FROM_GALLERY, mIsFromGallery)
|
||||||
putExtra(MEDIUM, path)
|
putExtra(PATH, path)
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
mPath = intent.getStringExtra(MEDIUM)
|
mPath = intent.getStringExtra(PATH)
|
||||||
mShowAll = config.showAll
|
mShowAll = config.showAll
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
|
|
|
@ -23,10 +23,10 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m
|
||||||
bundle.putSerializable(MEDIUM, medium)
|
bundle.putSerializable(MEDIUM, medium)
|
||||||
val fragment: ViewPagerFragment
|
val fragment: ViewPagerFragment
|
||||||
|
|
||||||
if (medium.video) {
|
fragment = if (medium.video) {
|
||||||
fragment = VideoFragment()
|
VideoFragment()
|
||||||
} else {
|
} else {
|
||||||
fragment = PhotoFragment()
|
PhotoFragment()
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment.arguments = bundle
|
fragment.arguments = bundle
|
||||||
|
|
|
@ -59,6 +59,7 @@ val NOMEDIA = ".nomedia"
|
||||||
|
|
||||||
val DIRECTORY = "directory"
|
val DIRECTORY = "directory"
|
||||||
val MEDIUM = "medium"
|
val MEDIUM = "medium"
|
||||||
|
val PATH = "path"
|
||||||
val GET_IMAGE_INTENT = "get_image_intent"
|
val GET_IMAGE_INTENT = "get_image_intent"
|
||||||
val GET_VIDEO_INTENT = "get_video_intent"
|
val GET_VIDEO_INTENT = "get_video_intent"
|
||||||
val GET_ANY_INTENT = "get_any_intent"
|
val GET_ANY_INTENT = "get_any_intent"
|
||||||
|
|
Loading…
Reference in a new issue