From 684164903a5c6f324e3e0b8c3941146b8b625a39 Mon Sep 17 00:00:00 2001 From: Jacocococo Date: Sat, 16 Mar 2024 23:08:55 +0100 Subject: [PATCH] Disable add reaction button upon reaching limit when using that button --- .../EmojiReactionsStatusDisplayItem.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) 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 009c47642..798a2b393 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 @@ -154,6 +154,7 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem { private final EmojiReactionsAdapter adapter; private final ListImageLoaderWrapper imgLoader; private int meReactionCount = 0; + private Instance instance; public Holder(Activity activity, ViewGroup parent) { super(activity, R.layout.display_item_emoji_reactions, parent); @@ -174,7 +175,7 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem { if(emojiKeyboard != null) root.removeView(emojiKeyboard.getView()); addButton.setSelected(false); AccountSession session=item.parentFragment.getSession(); - Instance instance=item.parentFragment.getInstance().get(); + instance=item.parentFragment.getInstance().get(); if(instance.configuration!=null && instance.configuration.reactions!=null && instance.configuration.reactions.maxReactions!=0){ meReactionCount=(int) item.status.reactions.stream().filter(r->r.me).count(); boolean canReact=meReactionCount