mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
rescale qr code bitmap in background
This commit is contained in:
parent
05ef61afd5
commit
7e4c39c79d
@ -633,16 +633,15 @@ public class ViewKeyActivity extends BaseActivity implements
|
|||||||
protected Bitmap doInBackground(Void... unused) {
|
protected Bitmap doInBackground(Void... unused) {
|
||||||
String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint;
|
String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint;
|
||||||
// render with minimal size
|
// 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) {
|
protected void onPostExecute(Bitmap qrCode) {
|
||||||
// scale the image up to our actual size. we do this in code rather
|
mQrCode.setImageBitmap(qrCode);
|
||||||
// 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
|
// simple fade-in animation
|
||||||
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);
|
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);
|
||||||
|
Loading…
Reference in New Issue
Block a user