|
|
@@ -18,6 +18,7 @@ import info.knacki.pass.io.IFileInterface;
|
|
|
import info.knacki.pass.io.OnResponseListener;
|
|
|
import info.knacki.pass.settings.SettingsManager;
|
|
|
import info.knacki.pass.ui.alertPrompt.AlertPromptGenerator;
|
|
|
+import info.knacki.pass.ui.alertPrompt.views.TextView;
|
|
|
import info.knacki.pass.ui.passwordPicker.PasswordPickerFactory;
|
|
|
|
|
|
public class EncryptionInformationActivity extends AppCompatActivity {
|
|
|
@@ -36,14 +37,6 @@ public class EncryptionInformationActivity extends AppCompatActivity {
|
|
|
fEncrypted = new File(filePath);
|
|
|
setContentView(R.layout.activity_encryption_infos);
|
|
|
|
|
|
- FillView();
|
|
|
- }
|
|
|
-
|
|
|
- private void FillView() {
|
|
|
- setTitle(FileUtils.TrimExtension(fEncrypted.getName()));
|
|
|
- IFileInterface f = FileInterfaceFactory.GetFileInterface(this, null, fEncrypted);
|
|
|
- ((AppCompatTextView) findViewById(R.id.filepath)).setText(fEncrypted.getName());
|
|
|
- ((AppCompatTextView) findViewById(R.id.enc_method)).setText(f.GetMethodName());
|
|
|
findViewById(R.id.change_encmethod).setOnClickListener((v) -> {
|
|
|
RadioGroup radioGroup = new RadioGroup(EncryptionInformationActivity.this);
|
|
|
final SettingsManager.EncryptionType prevEncType = FileInterfaceFactory.GetEncryptionType(fEncrypted);
|
|
|
@@ -86,5 +79,24 @@ public class EncryptionInformationActivity extends AppCompatActivity {
|
|
|
.setTitle(R.string.change_encmethod)
|
|
|
.show();
|
|
|
});
|
|
|
+ findViewById(R.id.remove).setOnClickListener((view) -> {
|
|
|
+ AlertPromptGenerator.StaticMake(this)
|
|
|
+ .setTitle(R.string.are_you_sure)
|
|
|
+ .setView(new TextView(this).SetText(String.format(getString(R.string.about_to_rm_file), fEncrypted.getName())))
|
|
|
+ .setPositiveButton(R.string.ok, (dialogInterface, v) -> {
|
|
|
+ fEncrypted.delete();
|
|
|
+ EncryptionInformationActivity.this.finish();
|
|
|
+ })
|
|
|
+ .setNegativeButton(R.string.cancel, null)
|
|
|
+ .show();
|
|
|
+ });
|
|
|
+ FillView();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void FillView() {
|
|
|
+ setTitle(FileUtils.TrimExtension(fEncrypted.getName()));
|
|
|
+ IFileInterface f = FileInterfaceFactory.GetFileInterface(this, null, fEncrypted);
|
|
|
+ ((AppCompatTextView) findViewById(R.id.filepath)).setText(fEncrypted.getName());
|
|
|
+ ((AppCompatTextView) findViewById(R.id.enc_method)).setText(f.GetMethodName());
|
|
|
}
|
|
|
}
|