properly fix Open Recycle Bin and Show all folders content

This commit is contained in:
tibbi 2023-02-05 16:27:56 +01:00
parent e28cb54a58
commit 2a94e9b811
4 changed files with 8 additions and 9 deletions

View file

@ -78,7 +78,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:095dd08ba9'
implementation 'com.github.SimpleMobileTools:Simple-Commons:50eeb2e717'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'

View file

@ -335,7 +335,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
mStoredMarkFavoriteItems = markFavoriteItems
mStoredThumbnailSpacing = thumbnailSpacing
mStoredRoundedCorners = fileRoundedCorners
mShowAll = showAll
mShowAll = showAll && mPath != RECYCLE_BIN
}
}
@ -373,16 +373,14 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
else -> getHumanizedFilename(mPath)
}
val searchHint = if (mPath == RECYCLE_BIN) {
getString(R.string.search_in_placeholder, dirName)
} else if (mShowAll) {
val searchHint = if (mShowAll) {
getString(R.string.search_files)
} else {
getString(R.string.search_in_placeholder, dirName)
}
media_menu.updateHintText(searchHint)
if (!mShowAll || mPath == RECYCLE_BIN) {
if (!mShowAll) {
media_menu.toggleForceArrowBackIcon(true)
media_menu.onNavigateBackClickListener = {
onBackPressed()

View file

@ -304,7 +304,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} else {
try {
mPath = intent.getStringExtra(PATH) ?: ""
mShowAll = config.showAll
// make sure "Open Recycle Bin" works well with "Show all folders content"
mShowAll = config.showAll && (mPath.isNotEmpty() && !mPath.startsWith(recycleBinPath))
} catch (e: Exception) {
showErrorToast(e)
finish()

View file

@ -33,8 +33,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage
val lastModifieds = if (getProperLastModified) mediaFetcher.getLastModifieds() else HashMap()
val dateTakens = if (getProperDateTaken) mediaFetcher.getDateTakens() else HashMap()
// make sure "Open Recycle Bin" works even from Show All Folders Content view
val media = if (showAll && mPath != RECYCLE_BIN) {
val media = if (showAll) {
val foldersToScan = mediaFetcher.getFoldersToScan().filter { it != RECYCLE_BIN && it != FAVORITES && !context.config.isFolderProtected(it) }
val media = ArrayList<Medium>()
foldersToScan.forEach {