mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix a glitch with the inability to display hidden files anymore
This commit is contained in:
@ -14,6 +14,7 @@ import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY
|
||||
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
|
||||
import com.simplemobiletools.commons.helpers.REAL_FILE_PATH
|
||||
import com.simplemobiletools.commons.helpers.isRPlus
|
||||
import com.simplemobiletools.gallery.pro.BuildConfig
|
||||
import com.simplemobiletools.gallery.pro.R
|
||||
import com.simplemobiletools.gallery.pro.extensions.*
|
||||
@ -101,6 +102,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
|
||||
val realPath = intent.extras!!.getString(REAL_FILE_PATH)
|
||||
if (realPath != null && getDoesFilePathExist(realPath)) {
|
||||
val avoidShowingHiddenFiles = isRPlus() && File(realPath).isHidden
|
||||
if (!avoidShowingHiddenFiles) {
|
||||
if (realPath.getFilenameFromPath().contains('.') || filename.contains('.')) {
|
||||
if (isFileTypeVisible(realPath)) {
|
||||
bottom_actions.beGone()
|
||||
@ -113,6 +116,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mUri!!.scheme == "file") {
|
||||
if (filename.contains('.')) {
|
||||
@ -124,6 +128,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||
return
|
||||
} else {
|
||||
val path = applicationContext.getRealPathFromURI(mUri!!) ?: ""
|
||||
val avoidShowingHiddenFiles = isRPlus() && File(path).isHidden
|
||||
if (!avoidShowingHiddenFiles) {
|
||||
if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && filename.contains('.') && getDoesFilePathExist(path)) {
|
||||
if (isFileTypeVisible(path)) {
|
||||
bottom_actions.beGone()
|
||||
@ -134,6 +140,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkNotchSupport()
|
||||
showSystemUI(true)
|
||||
|
@ -41,6 +41,7 @@ import com.github.penfeizhou.animation.webp.WebPDrawable
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.commons.helpers.isRPlus
|
||||
import com.simplemobiletools.gallery.pro.R
|
||||
import com.simplemobiletools.gallery.pro.activities.PanoramaPhotoActivity
|
||||
import com.simplemobiletools.gallery.pro.activities.PhotoActivity
|
||||
@ -165,6 +166,9 @@ class PhotoFragment : ViewPagerFragment() {
|
||||
|
||||
if (mMedium.path.startsWith("content://") && !mMedium.path.startsWith("content://mms/")) {
|
||||
mMedium.path = context!!.getRealPathFromURI(Uri.parse(mOriginalPath)) ?: mMedium.path
|
||||
if (isRPlus() && mMedium.path.startsWith("/storage/") && mMedium.isHidden()) {
|
||||
mMedium.path = mOriginalPath
|
||||
}
|
||||
|
||||
if (mMedium.path.isEmpty()) {
|
||||
var out: FileOutputStream? = null
|
||||
|
Reference in New Issue
Block a user