From b85f7a6747eb61ea4b7b7893688ea65f7103de01 Mon Sep 17 00:00:00 2001 From: Stypox Date: Thu, 28 Mar 2024 22:46:19 +0100 Subject: [PATCH] Some more slight improvements --- .../newpipe/fragments/detail/DescriptionFragment.java | 2 +- .../fragments/list/channel/ChannelAboutFragment.java | 11 +++-------- .../fragments/list/channel/ChannelFragment.java | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index ba233559c..7fc66b42f 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -26,11 +26,11 @@ public class DescriptionFragment extends BaseDescriptionFragment { @State StreamInfo streamInfo; - public DescriptionFragment(final StreamInfo streamInfo) { this.streamInfo = streamInfo; } + @Nullable @Override protected Description getDescription() { diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java index 30c3aac5a..674a13c5b 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java @@ -26,10 +26,8 @@ public class ChannelAboutFragment extends BaseDescriptionFragment { @State protected ChannelInfo channelInfo; - public static ChannelAboutFragment getInstance(final @NonNull ChannelInfo channelInfo) { - final ChannelAboutFragment fragment = new ChannelAboutFragment(); - fragment.channelInfo = channelInfo; - return fragment; + ChannelAboutFragment(@NonNull final ChannelInfo channelInfo) { + this.channelInfo = channelInfo; } @@ -42,10 +40,7 @@ public class ChannelAboutFragment extends BaseDescriptionFragment { @Nullable @Override protected Description getDescription() { - return new Description( - channelInfo.getDescription(), - Description.PLAIN_TEXT - ); + return new Description(channelInfo.getDescription(), Description.PLAIN_TEXT); } @NonNull 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 b16f40a4a..7e83d9958 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 @@ -474,7 +474,7 @@ public class ChannelFragment extends BaseStateFragment if (ChannelTabHelper.showChannelTab( context, preferences, R.string.show_channel_tabs_about)) { tabAdapter.addFragment( - ChannelAboutFragment.getInstance(currentInfo), + new ChannelAboutFragment(currentInfo), context.getString(R.string.channel_tab_about)); } }