From cbab92ed87e84674667c121220261d4d88d360be Mon Sep 17 00:00:00 2001 From: Jacoco <63549689+Jacocococo@users.noreply.github.com> Date: Sat, 21 Dec 2024 17:34:28 +0100 Subject: [PATCH] Prevent double long press for reaction buttons --- .../org/joinmastodon/android/ui/views/EmojiReactionButton.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/views/EmojiReactionButton.java b/mastodon/src/main/java/org/joinmastodon/android/ui/views/EmojiReactionButton.java index 27322e456c..9247a368e3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/views/EmojiReactionButton.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/views/EmojiReactionButton.java @@ -25,7 +25,7 @@ public EmojiReactionButton(Context context, AttributeSet attrs, int defStyleAttr public boolean onTouchEvent(MotionEvent event) { // allow long click even if button is disabled int action=event.getAction(); - if(action==MotionEvent.ACTION_DOWN) + if(action==MotionEvent.ACTION_DOWN && !isEnabled()) handler.postDelayed(this::performLongClick, ViewConfiguration.getLongPressTimeout()); if(action==MotionEvent.ACTION_UP) handler.removeCallbacksAndMessages(null);