From e3486ebf7c673646ac7456c787ee17599a441eb5 Mon Sep 17 00:00:00 2001 From: Torge Rosendahl Date: Wed, 15 Feb 2023 18:00:45 -0500 Subject: [PATCH] added clickable link type switch for copy, to not copy hashtags and user IDs --- .../joinmastodon/android/ui/text/ClickableLinksDelegate.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/text/ClickableLinksDelegate.java b/mastodon/src/main/java/org/joinmastodon/android/ui/text/ClickableLinksDelegate.java index 1684458e1..4ae75ca3d 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/text/ClickableLinksDelegate.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/text/ClickableLinksDelegate.java @@ -113,6 +113,8 @@ public class ClickableLinksDelegate { } Runnable copyTextToClipboard = () -> { + //if target is not a link, don't copy + if (selectedSpan.getType() != LinkSpan.Type.URL) return; //copy link text to clipboard ClipboardManager clipboard = (ClipboardManager) view.getContext().getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setPrimaryClip(ClipData.newPlainText("", selectedSpan.getLink()));