diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt index d85c8d20..5ad36fa3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt @@ -31,6 +31,7 @@ class SettingsActivity : SimpleActivity() { setupShowHidden() setupHiddenItemPasswordProtection() setupAppPasswordProtection() + setupFileDeletionPasswordProtection() setupKeepLastModified() setupShowInfoBubble() setupEnableRootAccess() @@ -129,6 +130,28 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupFileDeletionPasswordProtection() { + settings_file_deletion_password_protection.isChecked = config.isDeletePasswordProtectionOn + settings_file_deletion_password_protection_holder.setOnClickListener { + val tabToShow = if (config.isDeletePasswordProtectionOn) config.deleteProtectionType else SHOW_ALL_TABS + SecurityDialog(this, config.deletePasswordHash, tabToShow) { hash, type, success -> + if (success) { + val hasPasswordProtection = config.isDeletePasswordProtectionOn + settings_file_deletion_password_protection.isChecked = !hasPasswordProtection + config.isDeletePasswordProtectionOn = !hasPasswordProtection + config.deletePasswordHash = if (hasPasswordProtection) "" else hash + config.deleteProtectionType = type + + if (config.isDeletePasswordProtectionOn) { + val confirmationTextId = if (config.deleteProtectionType == PROTECTION_FINGERPRINT) + R.string.fingerprint_setup_successfully else R.string.protection_setup_successfully + ConfirmationDialog(this, "", confirmationTextId, R.string.ok, 0) { } + } + } + } + } + } + private fun setupKeepLastModified() { settings_keep_last_modified.isChecked = config.keepLastModified settings_keep_last_modified_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt index cb7489c7..b0457ee3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt @@ -85,7 +85,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList openWith() R.id.cab_open_as -> openAs() R.id.cab_copy_to -> copyMoveTo(true) - R.id.cab_move_to -> copyMoveTo(false) + R.id.cab_move_to -> tryMoveFiles() R.id.cab_compress -> compressSelection() R.id.cab_decompress -> decompressSelection() R.id.cab_select_all -> selectAll() @@ -247,6 +247,12 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList + + + + + +