Allow copying metadata to clipboard
This commit is contained in:
parent
997267bad1
commit
d0d5373be9
2 changed files with 7 additions and 2 deletions
|
@ -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…
Reference in a new issue