fixing some glitches related to opening recycle bin from all files view

This commit is contained in:
tibbi 2023-02-05 15:59:49 +01:00
parent 5a9491624b
commit e28cb54a58
6 changed files with 9 additions and 8 deletions

View file

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

View file

@ -407,7 +407,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
} }
} }
val filename = applicationContext.getFilenameFromContentUri(saveUri) ?: "tmp.jpg" val filename = applicationContext.getFilenameFromContentUri(saveUri) ?: "tmp-${System.currentTimeMillis()}.jpg"
val newPath = "$folder/$filename" val newPath = "$folder/$filename"
val fileDirItem = FileDirItem(newPath, filename) val fileDirItem = FileDirItem(newPath, filename)
getFileOutputStream(fileDirItem, true) { getFileOutputStream(fileDirItem, true) {
@ -861,7 +861,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
val label = val label =
"sknahT .moc.slootelibomelpmis.www morf eno lanigiro eht daolnwod ytefas nwo ruoy roF .ppa eht fo noisrev ekaf a gnisu era uoY".reversed() "sknahT .moc.slootelibomelpmis.www morf eno lanigiro eht daolnwod ytefas nwo ruoy roF .ppa eht fo noisrev ekaf a gnisu era uoY".reversed()
runOnUiThread { runOnUiThread {
ConfirmationDialog(this, label, positive = com.simplemobiletools.commons.R.string.ok, negative = 0) { ConfirmationDialog(this, label, positive = R.string.ok, negative = 0) {
launchViewIntent("6629852208836920709=di?ved/sppa/erots/moc.elgoog.yalp//:sptth".reversed()) launchViewIntent("6629852208836920709=di?ved/sppa/erots/moc.elgoog.yalp//:sptth".reversed())
} }
} }

View file

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

View file

@ -11,7 +11,6 @@ import com.simplemobiletools.gallery.pro.models.Favorite
class SplashActivity : BaseSplashActivity() { class SplashActivity : BaseSplashActivity() {
override fun initActivity() { override fun initActivity() {
// check if previously selected favorite items have been properly migrated into the new Favorites table // check if previously selected favorite items have been properly migrated into the new Favorites table
if (config.wereFavoritesMigrated) { if (config.wereFavoritesMigrated) {
launchActivity() launchActivity()

View file

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

View file

@ -77,7 +77,6 @@ class MediaFetcher(val context: Context) {
} }
sortMedia(curMedia, context.config.getFolderSorting(curPath)) sortMedia(curMedia, context.config.getFolderSorting(curPath))
return curMedia return curMedia
} }