From 4e4b8efd6ea275d5fe2d07c188ab8a2581617ec6 Mon Sep 17 00:00:00 2001 From: Manoj Khanna Date: Fri, 20 Mar 2015 18:23:23 +0530 Subject: Reworked Notify class --- .../keychain/ui/EncryptTextActivity.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java index 847f745d7..c800153ae 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java @@ -198,8 +198,9 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv // Copy to clipboard copyToClipboard(result.getResultBytes()); result.createNotify(EncryptTextActivity.this).show(); - // Notify.showNotify(EncryptTextActivity.this, - // R.string.encrypt_sign_clipboard_successful, Notify.Style.INFO); + // Notify.create(EncryptTextActivity.this, + // R.string.encrypt_sign_clipboard_successful, Notify.Style.OK) + // .show(getSupportFragmentManager().findFragmentById(R.id.encrypt_text_fragment)); } } @@ -281,7 +282,8 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv protected boolean inputIsValid() { if (mMessage == null) { - Notify.showNotify(this, R.string.error_message, Notify.Style.ERROR); + Notify.create(this, R.string.error_message, Notify.Style.ERROR) + .show(getSupportFragmentManager().findFragmentById(R.id.encrypt_text_fragment)); return false; } @@ -289,11 +291,13 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv // symmetric encryption checks if (mPassphrase == null) { - Notify.showNotify(this, R.string.passphrases_do_not_match, Notify.Style.ERROR); + Notify.create(this, R.string.passphrases_do_not_match, Notify.Style.ERROR) + .show(getSupportFragmentManager().findFragmentById(R.id.encrypt_text_fragment)); return false; } if (mPassphrase.isEmpty()) { - Notify.showNotify(this, R.string.passphrase_must_not_be_empty, Notify.Style.ERROR); + Notify.create(this, R.string.passphrase_must_not_be_empty, Notify.Style.ERROR) + .show(getSupportFragmentManager().findFragmentById(R.id.encrypt_text_fragment)); return false; } @@ -304,7 +308,8 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv && mEncryptionKeyIds.length > 0); if (!gotEncryptionKeys && mSigningKeyId == 0) { - Notify.showNotify(this, R.string.select_encryption_or_signature_key, Notify.Style.ERROR); + Notify.create(this, R.string.select_encryption_or_signature_key, Notify.Style.ERROR) + .show(getSupportFragmentManager().findFragmentById(R.id.encrypt_text_fragment)); return false; } } -- cgit v1.2.3