diff --git a/app/src/main/java/com/amaze/filemanager/ui/dialogs/GeneralDialogCreation.java b/app/src/main/java/com/amaze/filemanager/ui/dialogs/GeneralDialogCreation.java index 0c7a553e25..eb412d18f1 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/dialogs/GeneralDialogCreation.java +++ b/app/src/main/java/com/amaze/filemanager/ui/dialogs/GeneralDialogCreation.java @@ -209,6 +209,10 @@ public static void deleteFilesDialog( sharedPreferences.getBoolean( PreferencesConstants.PREFERENCE_DELETE_CONFIRMATION, PreferencesConstants.DEFAULT_PREFERENCE_DELETE_CONFIRMATION); + boolean deletePermanently = + sharedPreferences.getBoolean( + PreferencesConstants.PREFERENCE_DELETE_PERMANENTLY_WITHOUT_CONFIRMATION, + PreferencesConstants.DEFAULT_PREFERENCE_DELETE_PERMANENTLY_WITHOUT_CONFIRMATION); View dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_delete, null); TextView deleteDisclaimerTextView = dialogView.findViewById(R.id.dialog_delete_disclaimer); final AppCompatCheckBox deletePermanentlyCheckbox = @@ -216,7 +220,11 @@ public static void deleteFilesDialog( if (positions.get(0).generateBaseFile().isLocal()) { // FIXME: make sure dialog is not shown for zero items // allow trash bin delete only for local files for now - deletePermanentlyCheckbox.setVisibility(View.VISIBLE); + if (deletePermanently) { + deletePermanentlyCheckbox.setVisibility(View.GONE); + } else { + deletePermanentlyCheckbox.setVisibility(View.VISIBLE); + } } else { deleteDisclaimerTextView.setText(context.getString(R.string.dialog_delete_disclaimer)); } diff --git a/app/src/main/java/com/amaze/filemanager/ui/fragments/preferencefragments/PreferencesConstants.kt b/app/src/main/java/com/amaze/filemanager/ui/fragments/preferencefragments/PreferencesConstants.kt index 5a02a269b2..891c66b485 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/fragments/preferencefragments/PreferencesConstants.kt +++ b/app/src/main/java/com/amaze/filemanager/ui/fragments/preferencefragments/PreferencesConstants.kt @@ -77,6 +77,7 @@ object PreferencesConstants { const val PREFERENCE_ZIP_EXTRACT_PATH = "extractpath" const val PREFERENCE_TEXTEDITOR_NEWSTACK = "texteditor_newstack" const val PREFERENCE_DELETE_CONFIRMATION = "delete_confirmation" + const val PREFERENCE_DELETE_PERMANENTLY_WITHOUT_CONFIRMATION = "delete_permanently_without_confirmation" const val PREFERENCE_DISABLE_PLAYER_INTENT_FILTERS = "disable_player_intent_filters" const val PREFERENCE_TRASH_BIN_RETENTION_NUM_OF_FILES = "retention_num_of_files" const val PREFERENCE_TRASH_BIN_RETENTION_DAYS = "retention_days" @@ -122,4 +123,5 @@ object PreferencesConstants { const val KEY_TRASH_BIN_CLEANUP_INTERVAL_HOURS = "trash_bin_cleanup_interval_hours" const val DEFAULT_PREFERENCE_DELETE_CONFIRMATION = true + const val DEFAULT_PREFERENCE_DELETE_PERMANENTLY_WITHOUT_CONFIRMATION = false } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7d3f97ae2a..1840277664 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -800,6 +800,8 @@ You only need to do this once, until the next time you select a new location for Unable to get package info from file \"%s\". Either the specified file is not an APK, or the package file is corrupt. Delete confirmation Ask for confirmation before deleting files. Disabling this is highly discouraged! + Delete permanently (Disable Trashbin) + Delete files permanently without moving to trashbin. Enabling this is highly discouraged! SSH/SFTP FTP Secure FTP diff --git a/app/src/main/res/xml/behavior_prefs.xml b/app/src/main/res/xml/behavior_prefs.xml index 980f26e466..428cf7acb5 100644 --- a/app/src/main/res/xml/behavior_prefs.xml +++ b/app/src/main/res/xml/behavior_prefs.xml @@ -30,6 +30,13 @@ app:key="delete_confirmation" app:summary="@string/preference_delete_confirmation_summary" app:title="@string/preference_delete_confirmation" /> +