summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorMatthew Wong <wongma@protonmail.ch>2015-12-31 04:28:42 -0500
committerMatthew Wong <wongma@protonmail.ch>2015-12-31 04:28:42 -0500
commit1d9e3b50a5e186e1f2b068739dfd66c3c3f8c8aa (patch)
tree3f0be62306b9844646dd7b4cc4df69ba4d97eaa1 /app/src/main/java
parent1c3a4fe763e6722d7398afe518f22c66254c356e (diff)
Delete option for websites
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
index dfe4f3c0..1ebf4828 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
@@ -46,8 +46,8 @@ public class AutofillFragment extends DialogFragment {
builder.setView(view);
- String packageName = getArguments().getString("packageName");
- String appName = getArguments().getString("appName");
+ final String packageName = getArguments().getString("packageName");
+ final String appName = getArguments().getString("appName");
isWeb = getArguments().getBoolean("isWeb");
// set the dialog icon and title or webName editText
@@ -132,6 +132,19 @@ public class AutofillFragment extends DialogFragment {
}
});
builder.setNegativeButton(R.string.dialog_cancel, null);
+ final SharedPreferences.Editor editor = prefs.edit();
+ if (isWeb) {
+ builder.setNeutralButton(R.string.autofill_apps_delete, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ if (packageName != null && !packageName.equals("")) {
+ editor.remove(packageName);
+ ((AutofillPreferenceActivity) getActivity()).recyclerAdapter.removeWebsite(packageName);
+ editor.apply();
+ }
+ }
+ });
+ }
return builder.create();
}