Skip to content

Commit

Permalink
Prevent double long press for reaction buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacocococo authored Dec 21, 2024
1 parent e336f15 commit cbab92e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cbab92e

Please sign in to comment.