From a335130ad4289a6d548440cea7ec6c429d2d3eb4 Mon Sep 17 00:00:00 2001 From: Nicholas <112583042+nicholas-signal@users.noreply.github.com> Date: Wed, 7 Sep 2022 08:40:31 -0400 Subject: [PATCH] Clear Selection on ACTION_UP if longClickCopySpan is not found. --- .../thoughtcrime/securesms/util/LongClickMovementMethod.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/LongClickMovementMethod.java b/app/src/main/java/org/thoughtcrime/securesms/util/LongClickMovementMethod.java index 51f074480..7d637cb1a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/LongClickMovementMethod.java +++ b/app/src/main/java/org/thoughtcrime/securesms/util/LongClickMovementMethod.java @@ -82,6 +82,8 @@ public class LongClickMovementMethod extends LinkMovementMethod { this.currentSpan = aSingleSpan; this.widget = widget; return gestureDetector.onTouchEvent(event); + } else if (action == MotionEvent.ACTION_UP && Selection.getSelectionEnd(buffer) > 0){ + Selection.setSelection(buffer, 0); } } else if (action == MotionEvent.ACTION_CANCEL) { // Remove Selections.