aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
diff options
context:
space:
mode:
authorMatthew Wong <wongma@protonmail.ch>2015-12-31 18:26:43 -0500
committerMatthew Wong <wongma@protonmail.ch>2015-12-31 18:26:43 -0500
commit963859b3476b330445e8e0d1ded0553b0a2cc18a (patch)
tree862836a91c673ff3c6235937b748b8be0d97b533 /app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
parenta3e10d3ca83c78f19d342a76caebefa924b8d705 (diff)
downloadHardenedPass-963859b3476b330445e8e0d1ded0553b0a2cc18a.tar.gz
HardenedPass-963859b3476b330445e8e0d1ded0553b0a2cc18a.zip
Fix settings and add "pick and match" option
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java9
1 files changed, 4 insertions, 5 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 474c3e35..0ad28a31 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
@@ -39,7 +39,7 @@ public class AutofillFragment extends DialogFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
// this fragment is only created from the settings page (AutofillPreferenceActivity)
// need to interact with the recyclerAdapter which is a member of activity
- AutofillPreferenceActivity callingActivity = (AutofillPreferenceActivity) getActivity();
+ final AutofillPreferenceActivity callingActivity = (AutofillPreferenceActivity) getActivity();
LayoutInflater inflater = callingActivity.getLayoutInflater();
final View view = inflater.inflate(R.layout.fragment_autofill, null);
@@ -137,10 +137,10 @@ public class AutofillFragment extends DialogFragment {
builder.setNeutralButton(R.string.autofill_apps_delete, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- if (((AutofillPreferenceActivity) getActivity()).recyclerAdapter != null
+ if (callingActivity.recyclerAdapter != null
&& packageName != null && !packageName.equals("")) {
editor.remove(packageName);
- ((AutofillPreferenceActivity) getActivity()).recyclerAdapter.removeWebsite(packageName);
+ callingActivity.recyclerAdapter.removeWebsite(packageName);
editor.apply();
}
}
@@ -181,8 +181,7 @@ public class AutofillFragment extends DialogFragment {
return;
}
String oldPackageName = getArguments().getString("packageName", "");
- int position = callingActivity.recyclerAdapter.getPosition(packageName);
- if (!oldPackageName.equals(packageName) && position != -1) {
+ if (!oldPackageName.equals(packageName) && prefs.getAll().containsKey(packageName)) {
webURL.setError("URL already exists");
return;
}