Extracted method
This commit is contained in:
@@ -75,22 +75,7 @@ public class EditSubkeyDialogFragment extends DialogFragment {
|
|||||||
sendMessageToHandler(MESSAGE_REVOKE, null);
|
sendMessageToHandler(MESSAGE_REVOKE, null);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
CustomAlertDialogBuilder stripAlertDialog = new CustomAlertDialogBuilder(getActivity());
|
showAlertDialog();
|
||||||
stripAlertDialog.setTitle(getResources().getString(R.string.title_alert_strip)).
|
|
||||||
setMessage(R.string.alert_strip).setCancelable(true);
|
|
||||||
stripAlertDialog.setPositiveButton(R.string.strip, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
|
||||||
sendMessageToHandler(MESSAGE_STRIP, null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
stripAlertDialog.setNegativeButton(R.string.btn_do_not_save, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
stripAlertDialog.show();
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sendMessageToHandler(MESSAGE_MOVE_KEY_TO_CARD, null);
|
sendMessageToHandler(MESSAGE_MOVE_KEY_TO_CARD, null);
|
||||||
@@ -110,6 +95,25 @@ public class EditSubkeyDialogFragment extends DialogFragment {
|
|||||||
return builder.show();
|
return builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showAlertDialog() {
|
||||||
|
CustomAlertDialogBuilder stripAlertDialog = new CustomAlertDialogBuilder(getActivity());
|
||||||
|
stripAlertDialog.setTitle(getResources().getString(R.string.title_alert_strip)).
|
||||||
|
setMessage(R.string.alert_strip).setCancelable(true);
|
||||||
|
stripAlertDialog.setPositiveButton(R.string.strip, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
sendMessageToHandler(MESSAGE_STRIP, null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
stripAlertDialog.setNegativeButton(R.string.btn_do_not_save, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
stripAlertDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send message back to handler which is initialized in a activity
|
* Send message back to handler which is initialized in a activity
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user