aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wong <wongma@protonmail.ch>2015-07-11 12:31:09 -0400
committerMatthew Wong <wongma@protonmail.ch>2015-07-11 12:31:09 -0400
commit20da17c2d835233e7a6f30d5c2f8b23364d95ade (patch)
tree4b0ec85e54a3bf0a5eb6e060dc3688b105ed3a52
parent5c46fea58d36b28e7ac4a1b744f3973c0e12ad50 (diff)
Undo lambda-ing
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java38
1 files changed, 25 insertions, 13 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java b/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java
index 38e7a7b9..6ebf6f91 100644
--- a/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java
+++ b/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java
@@ -58,27 +58,39 @@ public class pwgenDialogFragment extends DialogFragment {
textView = (TextView) view.findViewById(R.id.passwordText);
textView.setText(pwgen.generate(getActivity().getApplicationContext()).get(0));
- builder.setPositiveButton(getResources().getString(R.string.dialog_ok), (dialog, which) -> {
- setPreferences();
- TextView edit = (TextView) getActivity().findViewById(R.id.crypto_password_edit);
- TextView generate = (TextView) getDialog().findViewById(R.id.passwordText);
- edit.append(generate.getText());
+ builder.setPositiveButton(getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ pwgenDialogFragment.this.setPreferences();
+ TextView edit = (TextView) pwgenDialogFragment.this.getActivity().findViewById(R.id.crypto_password_edit);
+ TextView generate = (TextView) pwgenDialogFragment.this.getDialog().findViewById(R.id.passwordText);
+ edit.append(generate.getText());
+ }
});
- builder.setNegativeButton(getResources().getString(R.string.dialog_cancel), (dialog, which) -> {
+ builder.setNegativeButton(getResources().getString(R.string.dialog_cancel), new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ }
});
builder.setNeutralButton(getResources().getString(R.string.pwgen_generate), null);
final AlertDialog ad = builder.setTitle("Generate Password").create();
- ad.setOnShowListener(dialog -> {
- Button b = ad.getButton(AlertDialog.BUTTON_NEUTRAL);
- b.setOnClickListener(v -> {
- setPreferences();
- TextView textView1 = (TextView) getDialog().findViewById(R.id.passwordText);
- textView1.setText(pwgen.generate(getActivity().getApplicationContext()).get(0));
- });
+ ad.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface dialog) {
+ Button b = ad.getButton(AlertDialog.BUTTON_NEUTRAL);
+ b.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ pwgenDialogFragment.this.setPreferences();
+ TextView textView1 = (TextView) pwgenDialogFragment.this.getDialog().findViewById(R.id.passwordText);
+ textView1.setText(pwgen.generate(pwgenDialogFragment.this.getActivity().getApplicationContext()).get(0));
+ }
+ });
+ }
});
return ad;
}