Revert "rescale qr code bitmap in background"

size of view may not be available in background thread.

This reverts commit 7e4c39c79d.
This commit is contained in:
Dominik Schürmann 2015-03-03 00:26:36 +01:00
parent 363d41ed1d
commit d3f54d3ace

View File

@ -633,15 +633,16 @@ public class ViewKeyActivity extends BaseActivity implements
protected Bitmap doInBackground(Void... unused) {
String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint;
// render with minimal size
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);
return QrCodeUtils.getQRCodeBitmap(qrCodeContent, 0);
}
protected void onPostExecute(Bitmap qrCode) {
mQrCode.setImageBitmap(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);
// simple fade-in animation
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);