Skip to content

Commit

Permalink
Allow copying metadata to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Mar 31, 2021
1 parent 346dacd commit f24af09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
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;
Expand Down Expand Up @@ -139,6 +140,8 @@ private void addMetadataItem(final LayoutInflater inflater,

final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false);
binding.metadataTypeView.setText(type);
binding.metadataTypeView.setOnClickListener(
v -> ShareUtils.copyToClipboard(layout.getContext(), content));

if (linkifyContent) {
TextLinkifier.createLinksFromPlainText(layout.getContext(), content,
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f24af09

Please sign in to comment.