From 284a12666fbb6d88b9190ecca287f16e8c3b7881 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 14 Jun 2018 09:43:34 +0200 Subject: [PATCH] reset SkipDeleteConfirmation 5 mins after backgrounding --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 3 ++- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 3 ++- .../kotlin/com/simplemobiletools/gallery/helpers/Constants.kt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 09098adaf..f26660cab 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -176,9 +176,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { override fun onStop() { super.onStop() - if (config.temporarilyShowHidden) { + if (config.temporarilyShowHidden || config.tempSkipDeleteConfirmation) { mTempShowHiddenHandler.postDelayed({ config.temporarilyShowHidden = false + config.tempSkipDeleteConfirmation = false }, SHOW_TEMP_HIDDEN_DURATION) } else { mTempShowHiddenHandler.removeCallbacksAndMessages(null) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index fa5ebcb5f..29c5d956b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -162,9 +162,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { super.onStop() mSearchMenuItem?.collapseActionView() - if (config.temporarilyShowHidden) { + if (config.temporarilyShowHidden || config.tempSkipDeleteConfirmation) { mTempShowHiddenHandler.postDelayed({ config.temporarilyShowHidden = false + config.tempSkipDeleteConfirmation = false }, SHOW_TEMP_HIDDEN_DURATION) } else { mTempShowHiddenHandler.removeCallbacksAndMessages(null) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 9d73f8dfe..e3b86de96 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -64,7 +64,7 @@ const val SLIDESHOW_SCROLL_DURATION = 500L const val NOMEDIA = ".nomedia" const val MAX_COLUMN_COUNT = 20 -const val SHOW_TEMP_HIDDEN_DURATION = 600000L +const val SHOW_TEMP_HIDDEN_DURATION = 300000L const val CLICK_MAX_DURATION = 150 const val DRAG_THRESHOLD = 8