From 6c8157152e722c8551ca60842e964ea7f6585034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Tue, 8 Apr 2014 11:44:11 +0200 Subject: [PATCH 1/4] Replaced Toasts in ImportKeysOrCodeFragment --- .../keychain/ui/ImportKeysQrCodeFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysQrCodeFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysQrCodeFragment.java index 8b553d273..adfffd8c9 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysQrCodeFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysQrCodeFragment.java @@ -29,9 +29,9 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; -import android.widget.Toast; import com.beardedhen.androidbootstrap.BootstrapButton; +import com.devspark.appmsg.AppMsg; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; @@ -123,7 +123,7 @@ public class ImportKeysQrCodeFragment extends Fragment { } // fail... - Toast.makeText(getActivity(), R.string.import_qr_code_wrong, Toast.LENGTH_LONG) + AppMsg.makeText(getActivity(), R.string.import_qr_code_wrong, AppMsg.STYLE_ALERT) .show(); } @@ -159,7 +159,7 @@ public class ImportKeysQrCodeFragment extends Fragment { } if (mScannedContent == null || counter > mScannedContent.length) { - Toast.makeText(getActivity(), R.string.import_qr_code_start_with_one, Toast.LENGTH_LONG) + AppMsg.makeText(getActivity(), R.string.import_qr_code_start_with_one, AppMsg.STYLE_ALERT) .show(); return; } From 01991aa127b491ae52b98a170967829313aa5236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Tue, 8 Apr 2014 11:57:17 +0200 Subject: [PATCH 2/4] Removed unused Toast import in ViewKeyActivityJB --- .../org/sufficientlysecure/keychain/ui/ViewKeyActivityJB.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivityJB.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivityJB.java index 6f52ea916..2b57b2bf0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivityJB.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivityJB.java @@ -28,7 +28,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.widget.Toast; import com.devspark.appmsg.AppMsg; From 2a9eaaa1fbab517df00f0f2f0367acc66a321b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Wed, 9 Apr 2014 14:39:59 +0200 Subject: [PATCH 3/4] Replaced Toasts in ViewKeyActivity --- .../keychain/ui/ViewKeyActivity.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index e01f3397b..d8a334032 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -30,7 +30,8 @@ import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.MenuItem; import android.view.Window; -import android.widget.Toast; + +import com.devspark.appmsg.AppMsg; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; @@ -194,8 +195,8 @@ public class ViewKeyActivity extends ActionBarActivity { String fingerprint = PgpKeyHelper.convertFingerprintToHex(data); content = Constants.FINGERPRINT_SCHEME + ":" + fingerprint; } else { - Toast.makeText(getApplicationContext(), "Bad key selected!", - Toast.LENGTH_LONG).show(); + AppMsg.makeText(this, "Bad key selected!", + AppMsg.STYLE_ALERT).show(); return; } } else { @@ -211,8 +212,8 @@ public class ViewKeyActivity extends ActionBarActivity { // Android will fail with android.os.TransactionTooLargeException if key is too big // see http://www.lonestarprod.com/?p=34 if (content.length() >= 86389) { - Toast.makeText(getApplicationContext(), R.string.key_too_big_for_sharing, - Toast.LENGTH_LONG).show(); + AppMsg.makeText(this, R.string.key_too_big_for_sharing, + AppMsg.STYLE_ALERT).show(); return; } } catch (ProviderHelper.NotFoundException e) { @@ -247,11 +248,14 @@ public class ViewKeyActivity extends ActionBarActivity { this, new long[]{masterKeyId}); ClipboardReflection.copyToClipboard(this, keyringArmored.get(0)); - Toast.makeText(getApplicationContext(), R.string.key_copied_to_clipboard, Toast.LENGTH_LONG) - .show(); + AppMsg.makeText(this, R.string.key_copied_to_clipboard, AppMsg.STYLE_INFO) + .show(); } catch (ProviderHelper.NotFoundException e) { Log.e(Constants.TAG, "key not found!", e); } + ClipboardReflection.copyToClipboard(this, keyringArmored.get(0)); + AppMsg.makeText(this, R.string.key_copied_to_clipboard, AppMsg.STYLE_INFO) + .show(); } private void shareNfc() { From 8ff9b768a3ac1f9487dfbc18225431be7056c4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Thu, 10 Apr 2014 00:08:26 +0200 Subject: [PATCH 4/4] Deleted wrong AppMsg --- .../org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index d8a334032..5f26e6a24 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -253,9 +253,6 @@ public class ViewKeyActivity extends ActionBarActivity { } catch (ProviderHelper.NotFoundException e) { Log.e(Constants.TAG, "key not found!", e); } - ClipboardReflection.copyToClipboard(this, keyringArmored.get(0)); - AppMsg.makeText(this, R.string.key_copied_to_clipboard, AppMsg.STYLE_INFO) - .show(); } private void shareNfc() {