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
|
mUri = intent.data ?: return
|
||||||
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
|
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
|
||||||
val realPath = intent.extras.getString(REAL_FILE_PATH)
|
val realPath = intent.extras.getString(REAL_FILE_PATH)
|
||||||
sendViewPagerIntent(realPath)
|
if (realPath?.getFilenameFromPath()?.contains('.') == true) {
|
||||||
finish()
|
sendViewPagerIntent(realPath)
|
||||||
return
|
finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false)
|
mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false)
|
||||||
if (mUri!!.scheme == "file") {
|
if (mUri!!.scheme == "file") {
|
||||||
scanPathRecursively(mUri!!.path)
|
if (mUri!!.path?.getFilenameFromPath()?.contains('.') == true) {
|
||||||
sendViewPagerIntent(mUri!!.path)
|
scanPathRecursively(mUri!!.path)
|
||||||
finish()
|
sendViewPagerIntent(mUri!!.path)
|
||||||
return
|
finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val path = applicationContext.getRealPathFromURI(mUri!!) ?: ""
|
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)
|
scanPathRecursively(mUri!!.path)
|
||||||
sendViewPagerIntent(path)
|
sendViewPagerIntent(path)
|
||||||
finish()
|
finish()
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>) {
|
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) {
|
if (isDirEmpty(media) || media.hashCode() == mPrevHashcode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue