From 5532666ad5459af9eb43fc8f811a0f0c9dbd2907 Mon Sep 17 00:00:00 2001 From: Abanoub Sameh Date: Sun, 6 Jun 2021 00:36:39 +0200 Subject: [PATCH] Long press on player share button to copy url to clipboard --- app/src/main/java/org/schabi/newpipe/player/Player.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index d51a25789..ccab05a86 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -532,6 +532,7 @@ public final class Player implements binding.moreOptionsButton.setOnClickListener(this); binding.moreOptionsButton.setOnLongClickListener(this); binding.share.setOnClickListener(this); + binding.share.setOnLongClickListener(this); binding.fullScreenButton.setOnClickListener(this); binding.screenRotationButton.setOnClickListener(this); binding.playWithKodi.setOnClickListener(this); @@ -3629,6 +3630,10 @@ public final class Player implements fragmentListener.onMoreOptionsLongClicked(); hideControls(0, 0); hideSystemUIIfNeeded(); + } else if (v.getId() == binding.share.getId()) { + if (currentMetadata != null) { + ShareUtils.copyToClipboard(context, currentMetadata.getMetadata().getOriginalUrl()); + } } return true; }