aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java49
1 files changed, 25 insertions, 24 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 85bfba224..faac9b157 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -63,6 +63,7 @@ import android.widget.Toast;
import android.widget.ViewFlipper;
import com.beardedhen.androidbootstrap.BootstrapButton;
+import com.devspark.appmsg.AppMsg;
public class EncryptActivity extends DrawerActivity {
@@ -100,8 +101,8 @@ public class EncryptActivity extends DrawerActivity {
private int mEncryptTarget;
- private EditText mPassPhrase = null;
- private EditText mPassPhraseAgain = null;
+ private EditText mPassphrase = null;
+ private EditText mPassphraseAgain = null;
private CheckBox mAsciiArmor = null;
private Spinner mFileCompression = null;
@@ -415,17 +416,17 @@ public class EncryptActivity extends DrawerActivity {
mOutputFilename = guessOutputFilename(mInputFilename);
if (mInputFilename.equals("")) {
- Toast.makeText(this, R.string.no_file_selected, Toast.LENGTH_SHORT).show();
+ AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
return;
}
if (!mInputFilename.startsWith("content")) {
File file = new File(mInputFilename);
if (!file.exists() || !file.isFile()) {
- Toast.makeText(
+ AppMsg.makeText(
this,
getString(R.string.error_message,
- getString(R.string.error_file_not_found)), Toast.LENGTH_SHORT)
+ getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT)
.show();
return;
}
@@ -435,16 +436,16 @@ public class EncryptActivity extends DrawerActivity {
// symmetric encryption
if (mMode.getCurrentView().getId() == R.id.modeSymmetric) {
boolean gotPassPhrase = false;
- String passPhrase = mPassPhrase.getText().toString();
- String passPhraseAgain = mPassPhraseAgain.getText().toString();
- if (!passPhrase.equals(passPhraseAgain)) {
- Toast.makeText(this, R.string.passphrases_do_not_match, Toast.LENGTH_SHORT).show();
+ String passphrase = mPassphrase.getText().toString();
+ String passphraseAgain = mPassphraseAgain.getText().toString();
+ if (!passphrase.equals(passphraseAgain)) {
+ AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show();
return;
}
- gotPassPhrase = (passPhrase.length() != 0);
+ gotPassPhrase = (passphrase.length() != 0);
if (!gotPassPhrase) {
- Toast.makeText(this, R.string.passphrase_must_not_be_empty, Toast.LENGTH_SHORT)
+ AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT)
.show();
return;
}
@@ -452,13 +453,13 @@ public class EncryptActivity extends DrawerActivity {
boolean encryptIt = (mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0);
// for now require at least one form of encryption for files
if (!encryptIt && mEncryptTarget == Id.target.file) {
- Toast.makeText(this, R.string.select_encryption_key, Toast.LENGTH_SHORT).show();
+ AppMsg.makeText(this, R.string.select_encryption_key, AppMsg.STYLE_ALERT).show();
return;
}
if (!encryptIt && mSecretKeyId == 0) {
- Toast.makeText(this, R.string.select_encryption_or_signature_key,
- Toast.LENGTH_SHORT).show();
+ AppMsg.makeText(this, R.string.select_encryption_or_signature_key,
+ AppMsg.STYLE_ALERT).show();
return;
}
@@ -549,11 +550,11 @@ public class EncryptActivity extends DrawerActivity {
if (mMode.getCurrentView().getId() == R.id.modeSymmetric) {
Log.d(Constants.TAG, "Symmetric encryption enabled!");
- String passPhrase = mPassPhrase.getText().toString();
- if (passPhrase.length() == 0) {
- passPhrase = null;
+ String passphrase = mPassphrase.getText().toString();
+ if (passphrase.length() == 0) {
+ passphrase = null;
}
- data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passPhrase);
+ data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passphrase);
} else {
mSecretKeyIdToPass = mSecretKeyId;
encryptionKeyIds = mEncryptionKeyIds;
@@ -618,8 +619,8 @@ public class EncryptActivity extends DrawerActivity {
output = data.getString(KeychainIntentService.RESULT_ENCRYPTED_STRING);
Log.d(Constants.TAG, "output: " + output);
ClipboardReflection.copyToClipboard(EncryptActivity.this, output);
- Toast.makeText(EncryptActivity.this,
- R.string.encryption_to_clipboard_successful, Toast.LENGTH_SHORT)
+ AppMsg.makeText(EncryptActivity.this,
+ R.string.encryption_to_clipboard_successful, AppMsg.STYLE_INFO)
.show();
break;
@@ -640,8 +641,8 @@ public class EncryptActivity extends DrawerActivity {
break;
case Id.target.file:
- Toast.makeText(EncryptActivity.this, R.string.encryption_successful,
- Toast.LENGTH_SHORT).show();
+ AppMsg.makeText(EncryptActivity.this, R.string.encryption_successful,
+ AppMsg.STYLE_INFO).show();
if (mDeleteAfter.isChecked()) {
// Create and show dialog to delete original file
@@ -765,8 +766,8 @@ public class EncryptActivity extends DrawerActivity {
mMainUserId = (TextView) findViewById(R.id.mainUserId);
mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest);
- mPassPhrase = (EditText) findViewById(R.id.passPhrase);
- mPassPhraseAgain = (EditText) findViewById(R.id.passPhraseAgain);
+ mPassphrase = (EditText) findViewById(R.id.passphrase);
+ mPassphraseAgain = (EditText) findViewById(R.id.passphraseAgain);
// measure the height of the source_file view and set the message view's min height to that,
// so it fills mSource fully... bit of a hack.