Search in sources :

Example 1 with ForgotPasswordDialog

use of run.wallet.iota.ui.dialog.ForgotPasswordDialog in project run-wallet-android by runplay.

the class UiManager method checkPin.

public static void checkPin(final Activity activity) {
    if (!Store.isLoggedIn()) {
        if (dialog != null) {
            dialog.dismiss();
            dialog = null;
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.PinDialog);
        final View dialogView = View.inflate(activity, R.layout.dialog_password, null);
        text = (TextView) dialogView.findViewById(R.id.pass_userPin);
        Button ib0 = (Button) dialogView.findViewById(R.id.button0);
        assert ib0 != null;
        ib0.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "0");
            }
        });
        Button ib1 = (Button) dialogView.findViewById(R.id.button1);
        assert ib1 != null;
        ib1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "1");
            }
        });
        Button ib2 = (Button) dialogView.findViewById(R.id.button2);
        assert ib2 != null;
        ib2.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "2");
            }
        });
        Button ib3 = (Button) dialogView.findViewById(R.id.button3);
        assert ib3 != null;
        ib3.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "3");
            }
        });
        Button ib4 = (Button) dialogView.findViewById(R.id.button4);
        assert ib4 != null;
        ib4.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "4");
            }
        });
        Button ib5 = (Button) dialogView.findViewById(R.id.button5);
        assert ib5 != null;
        ib5.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "5");
            }
        });
        Button ib6 = (Button) dialogView.findViewById(R.id.button6);
        assert ib6 != null;
        ib6.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "6");
            }
        });
        Button ib7 = (Button) dialogView.findViewById(R.id.button7);
        assert ib7 != null;
        ib7.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "7");
            }
        });
        Button ib8 = (Button) dialogView.findViewById(R.id.button8);
        assert ib8 != null;
        ib8.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "8");
            }
        });
        Button ib9 = (Button) dialogView.findViewById(R.id.button9);
        assert ib9 != null;
        ib9.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                enterNum(activity, dialogView, "9");
            }
        });
        ImageButton enter = (ImageButton) dialogView.findViewById(R.id.imageButtonEnter);
        assert enter != null;
        final ImageButton cancel = (ImageButton) dialogView.findViewById(R.id.imageButtonCancel);
        assert cancel != null;
        cancel.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                text.setText("");
            }
        });
        final Button clear = (Button) dialogView.findViewById(R.id.buttonReset);
        assert clear != null;
        clear.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                ForgotPasswordDialog forgotPasswordDialog = new ForgotPasswordDialog();
                forgotPasswordDialog.show(activity.getFragmentManager(), null);
            }
        });
        builder.setView(dialogView);
        builder.setOnCancelListener(new DialogInterface.OnCancelListener() {

            @Override
            public void onCancel(DialogInterface dialog) {
                activity.finishAffinity();
            }
        });
        dialog = builder.create();
        dialog.show();
        enter.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                login(activity, true);
            }
        });
    }
}
Also used : AlertDialog(android.app.AlertDialog) ImageButton(android.widget.ImageButton) ImageButton(android.widget.ImageButton) Button(android.widget.Button) DialogInterface(android.content.DialogInterface) ForgotPasswordDialog(run.wallet.iota.ui.dialog.ForgotPasswordDialog) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with ForgotPasswordDialog

use of run.wallet.iota.ui.dialog.ForgotPasswordDialog in project run-wallet-android by runplay.

the class PasswordLoginFragment method onPasswordForgotClick.

@OnClick(R.id.password_forgot)
public void onPasswordForgotClick() {
    ForgotPasswordDialog forgotPasswordDialog = new ForgotPasswordDialog();
    forgotPasswordDialog.show(getActivity().getFragmentManager(), null);
}
Also used : ForgotPasswordDialog(run.wallet.iota.ui.dialog.ForgotPasswordDialog) OnClick(butterknife.OnClick)

Aggregations

ForgotPasswordDialog (run.wallet.iota.ui.dialog.ForgotPasswordDialog)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 View (android.view.View)1 Button (android.widget.Button)1 ImageButton (android.widget.ImageButton)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 OnClick (butterknife.OnClick)1