mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-23 23:39:14 +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;
|
package me.impy.aegis.ui.views;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
@ -61,8 +65,17 @@ public class KeyProfileHolder extends RecyclerView.ViewHolder {
|
||||||
_profileIssuer.setText(" - " + profile.getEntry().getInfo().getIssuer());
|
_profileIssuer.setText(" - " + profile.getEntry().getInfo().getIssuer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
TextDrawable drawable = profile.getDrawable();
|
||||||
_profileDrawable.setImageDrawable(drawable);
|
_profileDrawable.setImageDrawable(drawable);
|
||||||
|
}
|
||||||
|
|
||||||
refreshCode();
|
refreshCode();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue