added clickable link type switch for copy, to not copy hashtags and user IDs

This commit is contained in:
Torge Rosendahl 2023-02-15 18:00:45 -05:00
parent c0115f068c
commit e3486ebf7c
1 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,8 @@ public class ClickableLinksDelegate {
} }
Runnable copyTextToClipboard = () -> { Runnable copyTextToClipboard = () -> {
//if target is not a link, don't copy
if (selectedSpan.getType() != LinkSpan.Type.URL) return;
//copy link text to clipboard //copy link text to clipboard
ClipboardManager clipboard = (ClipboardManager) view.getContext().getSystemService(Context.CLIPBOARD_SERVICE); ClipboardManager clipboard = (ClipboardManager) view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setPrimaryClip(ClipData.newPlainText("", selectedSpan.getLink())); clipboard.setPrimaryClip(ClipData.newPlainText("", selectedSpan.getLink()));