aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-03-02 18:44:09 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-03-02 18:44:24 +0100
commit7e4c39c79d1adb58f3181c9674309b1faaecc864 (patch)
treef62f6fdb868b80e1ab9696083f5fdd5683a8e884
parent05ef61afd5ba85e4da0e3e7242bf44821e278150 (diff)
downloadopen-keychain-7e4c39c79d1adb58f3181c9674309b1faaecc864.tar.gz
open-keychain-7e4c39c79d1adb58f3181c9674309b1faaecc864.tar.bz2
open-keychain-7e4c39c79d1adb58f3181c9674309b1faaecc864.zip
rescale qr code bitmap in background
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java13
1 files changed, 6 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 0be6c26f6..83e928ec6 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -633,16 +633,15 @@ public class ViewKeyActivity extends BaseActivity implements
protected Bitmap doInBackground(Void... unused) {
String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint;
// render with minimal size
- return QrCodeUtils.getQRCodeBitmap(qrCodeContent, 0);
+ Bitmap qrCode = QrCodeUtils.getQRCodeBitmap(qrCodeContent, 0);
+ // scale the image up to our actual size. we do this in code rather
+ // than let the ImageView do this because we don't require filtering.
+ return Bitmap.createScaledBitmap(qrCode, mQrCode.getHeight(),
+ mQrCode.getHeight(), false);
}
protected void onPostExecute(Bitmap qrCode) {
- // scale the image up to our actual size. we do this in code rather
- // than let the ImageView do this because we don't require filtering.
- Bitmap scaled = Bitmap.createScaledBitmap(qrCode,
- mQrCode.getHeight(), mQrCode.getHeight(),
- false);
- mQrCode.setImageBitmap(scaled);
+ mQrCode.setImageBitmap(qrCode);
// simple fade-in animation
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);