Simplify dialogs according to Material Design

This commit is contained in:
Dominik Schürmann 2015-03-04 11:36:26 +01:00
parent c17599f13f
commit aba6569dd2
3 changed files with 13 additions and 17 deletions

View File

@ -62,12 +62,9 @@ public class DeleteFileDialogFragment extends DialogFragment {
CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity); CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);
alert.setIcon(R.drawable.ic_dialog_alert_holo_light);
alert.setTitle(R.string.warning);
alert.setMessage(this.getString(R.string.file_delete_confirmation, deleteFilename)); alert.setMessage(this.getString(R.string.file_delete_confirmation, deleteFilename));
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { alert.setPositiveButton(R.string.btn_delete, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {

View File

@ -83,8 +83,6 @@ public class DeleteKeyDialogFragment extends DialogFragment {
mMainMessage = (TextView) mInflateView.findViewById(R.id.mainMessage); mMainMessage = (TextView) mInflateView.findViewById(R.id.mainMessage);
builder.setTitle(R.string.warning);
final boolean hasSecret; final boolean hasSecret;
// If only a single key has been selected // If only a single key has been selected
@ -110,12 +108,14 @@ public class DeleteKeyDialogFragment extends DialogFragment {
} }
hasSecret = ((Long) data.get(KeyRings.HAS_ANY_SECRET)) == 1; hasSecret = ((Long) data.get(KeyRings.HAS_ANY_SECRET)) == 1;
// Set message depending on which key it is. if (hasSecret) {
mMainMessage.setText(getString( // show title only for secret key deletions,
hasSecret ? R.string.secret_key_deletion_confirmation // see http://www.google.com/design/spec/components/dialogs.html#dialogs-behavior
: R.string.public_key_deletetion_confirmation, builder.setTitle(getString(R.string.title_delete_secret_key, name));
name mMainMessage.setText(getString(R.string.secret_key_deletion_confirmation, name));
)); } else {
mMainMessage.setText(getString(R.string.public_key_deletetion_confirmation, name));
}
} catch (ProviderHelper.NotFoundException e) { } catch (ProviderHelper.NotFoundException e) {
dismiss(); dismiss();
return null; return null;
@ -125,7 +125,6 @@ public class DeleteKeyDialogFragment extends DialogFragment {
hasSecret = false; hasSecret = false;
} }
builder.setIcon(R.drawable.ic_dialog_alert_holo_light);
builder.setPositiveButton(R.string.btn_delete, new DialogInterface.OnClickListener() { builder.setPositiveButton(R.string.btn_delete, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {

View File

@ -42,6 +42,7 @@
<string name="title_exchange_keys">"Exchange Keys"</string> <string name="title_exchange_keys">"Exchange Keys"</string>
<string name="title_advanced_key_info">"Advanced Key Info"</string> <string name="title_advanced_key_info">"Advanced Key Info"</string>
<string name="title_keys">"Keys"</string> <string name="title_keys">"Keys"</string>
<string name="title_delete_secret_key">"Delete YOUR key \'%s\'?"</string>
<!-- section --> <!-- section -->
<string name="section_user_ids">"Identities"</string> <string name="section_user_ids">"Identities"</string>
@ -203,7 +204,6 @@
<string name="ecdh">"ECDH"</string> <string name="ecdh">"ECDH"</string>
<string name="ecdsa">"ECDSA"</string> <string name="ecdsa">"ECDSA"</string>
<string name="filemanager_title_open">"Open…"</string> <string name="filemanager_title_open">"Open…"</string>
<string name="warning">"Warning"</string>
<string name="error">"Error"</string> <string name="error">"Error"</string>
<string name="error_message">"Error: %s"</string> <string name="error_message">"Error: %s"</string>
@ -233,9 +233,9 @@
<string name="specify_file_to_encrypt_to">"Please specify which file to encrypt to.\nWARNING: File will be overwritten if it exists."</string> <string name="specify_file_to_encrypt_to">"Please specify which file to encrypt to.\nWARNING: File will be overwritten if it exists."</string>
<string name="specify_file_to_decrypt_to">"Please specify which file to decrypt to.\nWARNING: File will be overwritten if it exists."</string> <string name="specify_file_to_decrypt_to">"Please specify which file to decrypt to.\nWARNING: File will be overwritten if it exists."</string>
<string name="specify_file_to_export_to">"Please specify which file to export to.\nWARNING: File will be overwritten if it exists."</string> <string name="specify_file_to_export_to">"Please specify which file to export to.\nWARNING: File will be overwritten if it exists."</string>
<string name="key_deletion_confirmation_multi">"Do you really want to delete all selected public keys?\nYou can't undo this!"</string> <string name="key_deletion_confirmation_multi">"Do you really want to delete all selected keys?"</string>
<string name="secret_key_deletion_confirmation">"Do you really want to delete the SECRET key '%s'?\nYou can't undo this!"</string> <string name="secret_key_deletion_confirmation">"After deletion you will not be able to read messages encrypted with this key and loose all key verifications related to it!\nDo you really want to delete YOUR key '%s'?"</string>
<string name="public_key_deletetion_confirmation">"Do you really want to delete the public key '%s'?\nYou can't undo this!"</string> <string name="public_key_deletetion_confirmation">"Delete key '%s'?"</string>
<string name="also_export_secret_keys">"Also export secret keys"</string> <string name="also_export_secret_keys">"Also export secret keys"</string>
<string name="reinstall_openkeychain">"You encountered a known bug with Android. Please reinstall OpenKeychain if you want to link your contacts with keys."</string> <string name="reinstall_openkeychain">"You encountered a known bug with Android. Please reinstall OpenKeychain if you want to link your contacts with keys."</string>