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.StreamInfo;
|
||||
import org.schabi.newpipe.util.Localization;
|
||||
import org.schabi.newpipe.util.ShareUtils;
|
||||
import org.schabi.newpipe.util.TextLinkifier;
|
||||
|
||||
import icepick.State;
|
||||
|
@ -139,6 +140,10 @@ public class DescriptionFragment extends BaseFragment {
|
|||
|
||||
final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false);
|
||||
binding.metadataTypeView.setText(type);
|
||||
binding.metadataTypeView.setOnLongClickListener(v -> {
|
||||
ShareUtils.copyToClipboard(requireContext(), content);
|
||||
return true;
|
||||
});
|
||||
|
||||
if (linkifyContent) {
|
||||
TextLinkifier.createLinksFromPlainText(layout.getContext(), content,
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
<TextView
|
||||
android:id="@+id/metadata_type_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="end"
|
||||
android:gravity="center_vertical|end"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
|
|
Loading…
Reference in New Issue