None-square emoji for reactions

This commit is contained in:
Jacocococo 2024-02-12 21:16:13 +01:00 committed by LucasGGamerM
parent d121f14d30
commit 2021c335ac
2 changed files with 5 additions and 3 deletions

View File

@ -38,7 +38,7 @@ public class EmojiReaction {
reaction.staticUrl=info.staticUrl;
reaction.accounts=new ArrayList<>(Collections.singleton(me));
reaction.accountIds=new ArrayList<>(Collections.singleton(me.id));
reaction.request=new UrlImageLoaderRequest(info.url, V.sp(24), V.sp(24));
reaction.request=new UrlImageLoaderRequest(info.url, 0, V.sp(24));
return reaction;
}

View File

@ -172,7 +172,7 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem {
addButton.setSelected(false);
AccountSession session=item.parentFragment.getSession();
item.status.reactions.forEach(r->r.request=r.getUrl(item.playGifs)!=null
? new UrlImageLoaderRequest(r.getUrl(item.playGifs), V.sp(24), V.sp(24))
? new UrlImageLoaderRequest(r.getUrl(item.playGifs), 0, V.sp(24))
: null);
emojiKeyboard=new CustomEmojiPopupKeyboard(
(Activity) item.parentFragment.getContext(),
@ -342,7 +342,9 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem {
@Override
public void setImage(int index, Drawable drawable){
drawable.setBounds(0, 0, V.sp(24), V.sp(24));
int height=V.sp(24);
int width=drawable.getIntrinsicWidth()*height/drawable.getIntrinsicHeight();
drawable.setBounds(0, 0, width, height);
btn.setCompoundDrawablesRelative(drawable, null, null, null);
if(drawable instanceof Animatable) ((Animatable) drawable).start();
}