From 2021c335ac7772edadb20b775e7846830ade74dc Mon Sep 17 00:00:00 2001 From: Jacocococo Date: Mon, 12 Feb 2024 21:16:13 +0100 Subject: [PATCH] None-square emoji for reactions --- .../java/org/joinmastodon/android/model/EmojiReaction.java | 2 +- .../ui/displayitems/EmojiReactionsStatusDisplayItem.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/EmojiReaction.java b/mastodon/src/main/java/org/joinmastodon/android/model/EmojiReaction.java index 6007dfdb3..4ffed6e6d 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/EmojiReaction.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/EmojiReaction.java @@ -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; } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java index f75d17987..3eece8448 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java @@ -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(); }