Browse Source

Merge branch 'issue-30' of isundil/pass into master

isundil 7 years ago
parent
commit
735c247d60
1 changed files with 10 additions and 3 deletions
  1. 10 3
      app/src/main/java/info/knacki/pass/ui/MainActivity.java

+ 10 - 3
app/src/main/java/info/knacki/pass/ui/MainActivity.java

@@ -215,7 +215,15 @@ public class MainActivity extends AppCompatActivity implements PasswordEditListe
 
     @Override
     public void OnRemovePassword(File f) {
-        f.delete();
+        AlertPromptGenerator.StaticMake(this)
+                .setTitle(R.string.are_you_sure)
+                .setView(new TextView(this).SetText(String.format(getString(R.string.about_to_rm_file), f.getName())))
+                .setPositiveButton(R.string.ok, (dialogInterface, view) -> {
+                    f.delete();
+                    fPasswordListView.refresh();
+                })
+                .setNegativeButton(R.string.cancel, null)
+                .show();
         fPasswordListView.refresh();
     }
 
@@ -232,8 +240,7 @@ public class MainActivity extends AppCompatActivity implements PasswordEditListe
                     .setView(new TextView(this)
                             .SetText(R.string.about_to_rm_directory))
                     .setPositiveButton(R.string.ok, (dialogInterface, view) -> DoRemoveDir(f))
-                    .setNegativeButton(R.string.cancel, (dialogInterface, view) -> {
-                    })
+                    .setNegativeButton(R.string.cancel, null)
                     .show();
 
         } else {