copy post URL on long click

This commit is contained in:
sk 2022-12-19 15:14:54 +01:00 committed by LucasGGamerM
parent 05eceecbea
commit e4e9516d5d
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
bookmark.setAccessibilityDelegate(buttonAccessibilityDelegate); bookmark.setAccessibilityDelegate(buttonAccessibilityDelegate);
share.setOnTouchListener(this::onButtonTouch); share.setOnTouchListener(this::onButtonTouch);
share.setOnClickListener(this::onShareClick); share.setOnClickListener(this::onShareClick);
share.setOnLongClickListener(this::onShareLongClick);
share.setAccessibilityDelegate(buttonAccessibilityDelegate); share.setAccessibilityDelegate(buttonAccessibilityDelegate);
} }
@ -182,6 +183,11 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
v.getContext().startActivity(Intent.createChooser(intent, v.getContext().getString(R.string.share_toot_title))); 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){ private int descriptionForId(int id){
if(id==R.id.reply_btn) if(id==R.id.reply_btn)
return R.string.button_reply; return R.string.button_reply;