mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 06:15:48 +00:00
Delete option for websites
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
android:id="@+id/webURL"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/autofill_webURL_hint"
|
||||
android:hint="URL"
|
||||
android:inputType="textUri"/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
|
@@ -171,5 +171,5 @@
|
||||
<string name="autofill_apps_match_ellipsis">Match with…</string>
|
||||
<string name="autofill_apps_match">Match with</string>
|
||||
<string name="autofill_apps_never">Never match</string>
|
||||
<string name="autofill_webURL_hint">URL</string>
|
||||
<string name="autofill_apps_delete">Delete</string>
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user