From 89dc44be612224eb3bfc11579f66d1f4407de853 Mon Sep 17 00:00:00 2001 From: AudricV <74829229+AudricV@users.noreply.github.com> Date: Tue, 22 Aug 2023 19:14:17 +0200 Subject: [PATCH] Always show the About tab and support having no description --- .../detail/BaseDescriptionFragment.java | 19 +++++++++++-------- .../list/channel/ChannelFragment.java | 4 +--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java index 47f8598af..3b1ede432 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java @@ -129,10 +129,13 @@ public abstract class BaseDescriptionFragment extends BaseFragment { private void disableDescriptionSelection() { // show description content again, otherwise some links are not clickable - TextLinkifier.fromDescription(binding.detailDescriptionView, - getDescription(), HtmlCompat.FROM_HTML_MODE_LEGACY, - getService(), getStreamUrl(), - descriptionDisposables, SET_LINK_MOVEMENT_METHOD); + final Description description = getDescription(); + if (description != null) { + TextLinkifier.fromDescription(binding.detailDescriptionView, + description, HtmlCompat.FROM_HTML_MODE_LEGACY, + getService(), getStreamUrl(), + descriptionDisposables, SET_LINK_MOVEMENT_METHOD); + } binding.detailDescriptionNoteView.setVisibility(View.GONE); binding.detailDescriptionView.setTextIsSelectable(false); @@ -144,10 +147,10 @@ public abstract class BaseDescriptionFragment extends BaseFragment { } protected void addMetadataItem(final LayoutInflater inflater, - final LinearLayout layout, - final boolean linkifyContent, - @StringRes final int type, - @Nullable final String content) { + final LinearLayout layout, + final boolean linkifyContent, + @StringRes final int type, + @Nullable final String content) { if (isBlank(content)) { return; } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index f709fc226..6c0eb9792 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -470,9 +470,7 @@ public class ChannelFragment extends BaseStateFragment } } - final String description = currentInfo.getDescription(); - if (description != null && !description.isEmpty() - && ChannelTabHelper.showChannelTab( + if (ChannelTabHelper.showChannelTab( context, preferences, R.string.show_channel_tabs_about)) { tabAdapter.addFragment( ChannelAboutFragment.getInstance(currentInfo),