From ba36347f03278763ecec617b1ce57ba89db7be72 Mon Sep 17 00:00:00 2001 From: sk Date: Mon, 19 Dec 2022 15:14:54 +0100 Subject: [PATCH] copy post URL on long click --- .../android/ui/displayitems/FooterStatusDisplayItem.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java index dbabdd6bc..c42b1718a 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java @@ -77,6 +77,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{ favorite.setOnClickListener(this::onFavoriteClick); favorite.setAccessibilityDelegate(buttonAccessibilityDelegate); share.setOnClickListener(this::onShareClick); + share.setOnLongClickListener(this::onShareLongClick); share.setAccessibilityDelegate(buttonAccessibilityDelegate); } @@ -127,6 +128,11 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{ v.getContext().startActivity(Intent.createChooser(intent, v.getContext().getString(R.string.share_toot_title))); } + private boolean onShareLongClick(View v){ + UiUtils.copyText(v.getContext(), item.status.url); + return true; + } + private int descriptionForId(int id){ if(id==R.id.reply_btn) return R.string.button_reply;