aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index f5d89d186..6ff8d421b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -37,8 +37,6 @@ import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Spinner;
-import com.devspark.appmsg.AppMsg;
-
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
@@ -51,6 +49,7 @@ import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.util.Choice;
import org.sufficientlysecure.keychain.util.Log;
+import org.sufficientlysecure.keychain.util.Notify;
import java.io.File;
@@ -218,18 +217,18 @@ public class EncryptFileFragment extends Fragment {
}
if (mInputFilename.equals("")) {
- AppMsg.makeText(getActivity(), R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(getActivity(), R.string.no_file_selected, Notify.Style.ERROR);
return;
}
if (mInputUri == null && !mInputFilename.startsWith("content")) {
File file = new File(mInputFilename);
if (!file.exists() || !file.isFile()) {
- AppMsg.makeText(
+ Notify.showNotify(
getActivity(),
getString(R.string.error_message,
- getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT)
- .show();
+ getString(R.string.error_file_not_found)), Notify.Style.ERROR
+ );
return;
}
}
@@ -240,13 +239,13 @@ public class EncryptFileFragment extends Fragment {
boolean gotPassphrase = (mEncryptInterface.getPassphrase() != null
&& mEncryptInterface.getPassphrase().length() != 0);
if (!gotPassphrase) {
- AppMsg.makeText(getActivity(), R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT)
- .show();
+ Notify.showNotify(getActivity(), R.string.passphrase_must_not_be_empty, Notify.Style.ERROR)
+ ;
return;
}
if (!mEncryptInterface.getPassphrase().equals(mEncryptInterface.getPassphraseAgain())) {
- AppMsg.makeText(getActivity(), R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(getActivity(), R.string.passphrases_do_not_match, Notify.Style.ERROR);
return;
}
} else {
@@ -256,13 +255,13 @@ public class EncryptFileFragment extends Fragment {
&& mEncryptInterface.getEncryptionKeys().length > 0);
if (!gotEncryptionKeys) {
- AppMsg.makeText(getActivity(), R.string.select_encryption_key, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(getActivity(), R.string.select_encryption_key, Notify.Style.ERROR);
return;
}
if (!gotEncryptionKeys && mEncryptInterface.getSignatureKey() == 0) {
- AppMsg.makeText(getActivity(), R.string.select_encryption_or_signature_key,
- AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(getActivity(), R.string.select_encryption_or_signature_key,
+ Notify.Style.ERROR);
return;
}
@@ -345,8 +344,8 @@ public class EncryptFileFragment extends Fragment {
super.handleMessage(message);
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
- AppMsg.makeText(getActivity(), R.string.encrypt_sign_successful,
- AppMsg.STYLE_INFO).show();
+ Notify.showNotify(getActivity(), R.string.encrypt_sign_successful,
+ Notify.Style.INFO);
if (mDeleteAfter.isChecked()) {
// Create and show dialog to delete original file