Allow copying metadata to clipboard

pull/5946/head
Stypox 2021-03-31 21:29:59 +02:00
rodzic 997267bad1
commit d0d5373be9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -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,

Wyświetl plik

@ -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"