fix akkoma link previews not showing

closes sk22#183
This commit is contained in:
sk 2023-01-16 22:06:20 +01:00 committed by LucasGGamerM
parent 13b5462f63
commit d32a57a18d
1 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,12 @@ public class LinkCardStatusDisplayItem extends StatusDisplayItem{
photo.setImageDrawable(null);
if(item.imgRequest!=null){
crossfadeDrawable.setSize(card.width, card.height);
if (card.width > 0) {
// akkoma servers don't provide width and height
crossfadeDrawable.setSize(card.width, card.height);
} else {
crossfadeDrawable.setSize(itemView.getWidth(), itemView.getHeight());
}
crossfadeDrawable.setBlurhashDrawable(card.blurhashPlaceholder);
crossfadeDrawable.setCrossfadeAlpha(item.status.spoilerRevealed ? 0f : 1f);
photo.setImageDrawable(crossfadeDrawable);