mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-21 14:29:13 +00:00
ProfileHolder now shows correct image
This commit is contained in:
parent
11b195aab3
commit
34b6cf944f
1 changed files with 15 additions and 2 deletions
|
@ -1,6 +1,10 @@
|
|||
package me.impy.aegis.ui.views;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
@ -61,8 +65,17 @@ public class KeyProfileHolder extends RecyclerView.ViewHolder {
|
|||
_profileIssuer.setText(" - " + profile.getEntry().getInfo().getIssuer());
|
||||
}
|
||||
|
||||
TextDrawable drawable = profile.getDrawable();
|
||||
_profileDrawable.setImageDrawable(drawable);
|
||||
if (profile.getEntry().getInfo().getImage() != null)
|
||||
{
|
||||
byte[] imageBytes = profile.getEntry().getInfo().getImage();
|
||||
Bitmap image = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);
|
||||
_profileDrawable.setImageBitmap(image);
|
||||
}
|
||||
else
|
||||
{
|
||||
TextDrawable drawable = profile.getDrawable();
|
||||
_profileDrawable.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
refreshCode();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue