mirror of
https://github.com/TeamNewPipe/NewPipe/
synced 2025-02-03 12:17:38 +01:00
Allow copying metadata to clipboard
This commit is contained in:
parent
997267bad1
commit
d0d5373be9
@ -19,6 +19,7 @@ import org.schabi.newpipe.databinding.ItemMetadataBinding;
|
|||||||
import org.schabi.newpipe.extractor.stream.Description;
|
import org.schabi.newpipe.extractor.stream.Description;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfo;
|
import org.schabi.newpipe.extractor.stream.StreamInfo;
|
||||||
import org.schabi.newpipe.util.Localization;
|
import org.schabi.newpipe.util.Localization;
|
||||||
|
import org.schabi.newpipe.util.ShareUtils;
|
||||||
import org.schabi.newpipe.util.TextLinkifier;
|
import org.schabi.newpipe.util.TextLinkifier;
|
||||||
|
|
||||||
import icepick.State;
|
import icepick.State;
|
||||||
@ -139,6 +140,10 @@ public class DescriptionFragment extends BaseFragment {
|
|||||||
|
|
||||||
final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false);
|
final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false);
|
||||||
binding.metadataTypeView.setText(type);
|
binding.metadataTypeView.setText(type);
|
||||||
|
binding.metadataTypeView.setOnLongClickListener(v -> {
|
||||||
|
ShareUtils.copyToClipboard(requireContext(), content);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
if (linkifyContent) {
|
if (linkifyContent) {
|
||||||
TextLinkifier.createLinksFromPlainText(layout.getContext(), content,
|
TextLinkifier.createLinksFromPlainText(layout.getContext(), content,
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/metadata_type_view"
|
android:id="@+id/metadata_type_view"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:gravity="end"
|
android:gravity="center_vertical|end"
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user