fix #835, open files without extension at PhotoVideo activity
This commit is contained in:
parent
b53bd52adf
commit
9ed420daa1
|
@ -64,20 +64,24 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
|||
mUri = intent.data ?: return
|
||||
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
|
||||
val realPath = intent.extras.getString(REAL_FILE_PATH)
|
||||
sendViewPagerIntent(realPath)
|
||||
finish()
|
||||
return
|
||||
if (realPath?.getFilenameFromPath()?.contains('.') == true) {
|
||||
sendViewPagerIntent(realPath)
|
||||
finish()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false)
|
||||
if (mUri!!.scheme == "file") {
|
||||
scanPathRecursively(mUri!!.path)
|
||||
sendViewPagerIntent(mUri!!.path)
|
||||
finish()
|
||||
return
|
||||
if (mUri!!.path?.getFilenameFromPath()?.contains('.') == true) {
|
||||
scanPathRecursively(mUri!!.path)
|
||||
sendViewPagerIntent(mUri!!.path)
|
||||
finish()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
val path = applicationContext.getRealPathFromURI(mUri!!) ?: ""
|
||||
if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms") {
|
||||
if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && mUri!!.path.getFilenameFromPath().contains('.')) {
|
||||
scanPathRecursively(mUri!!.path)
|
||||
sendViewPagerIntent(path)
|
||||
finish()
|
||||
|
|
|
@ -1004,7 +1004,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
|
||||
private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>) {
|
||||
val media = thumbnailItems.filter { it is Medium }.map { it as Medium } as ArrayList<Medium>
|
||||
val media = thumbnailItems.asSequence().filter { it is Medium }.map { it as Medium }.toMutableList() as ArrayList<Medium>
|
||||
if (isDirEmpty(media) || media.hashCode() == mPrevHashcode) {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue