From 371f98677328e6fbfe85a8cbd30fd9a39c22321c Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 14 Apr 2023 11:00:01 +0200 Subject: [PATCH] Fix some code smells --- .../fragments/list/channel/ChannelTabFragment.java | 5 ----- .../java/org/schabi/newpipe/util/ChannelTabHelper.java | 9 ++++++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelTabFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelTabFragment.java index 3f400bdf8..df3aced50 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelTabFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelTabFragment.java @@ -15,7 +15,6 @@ import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.channel.ChannelTabInfo; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import org.schabi.newpipe.fragments.list.BaseListInfoFragment; -import org.schabi.newpipe.util.Constants; import org.schabi.newpipe.util.ExtractorHelper; import icepick.State; @@ -23,12 +22,8 @@ import io.reactivex.rxjava3.core.Single; public class ChannelTabFragment extends BaseListInfoFragment { - @State - protected int serviceId = Constants.NO_SERVICE_ID; - @State protected ListLinkHandler tabHandler; - @State protected String channelName; diff --git a/app/src/main/java/org/schabi/newpipe/util/ChannelTabHelper.java b/app/src/main/java/org/schabi/newpipe/util/ChannelTabHelper.java index 974445a96..d10e0a3dd 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ChannelTabHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ChannelTabHelper.java @@ -27,8 +27,9 @@ public final class ChannelTabHelper { case ChannelTabs.SHORTS: case ChannelTabs.LIVESTREAMS: return true; + default: + return false; } - return false; } /** @@ -61,8 +62,9 @@ public final class ChannelTabHelper { return R.string.show_channel_tabs_playlists; case ChannelTabs.ALBUMS: return R.string.show_channel_tabs_albums; + default: + return -1; } - return -1; } @StringRes @@ -82,8 +84,9 @@ public final class ChannelTabHelper { return R.string.channel_tab_playlists; case ChannelTabs.ALBUMS: return R.string.channel_tab_albums; + default: + return R.string.unknown_content; } - return R.string.unknown_content; } public static boolean showChannelTab(final Context context,