Fix some code smells

This commit is contained in:
Stypox 2023-04-14 11:00:01 +02:00
parent a1e8b9be4e
commit 371f986773
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
2 changed files with 6 additions and 8 deletions

View File

@ -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<InfoItem, ChannelTabInfo> {
@State
protected int serviceId = Constants.NO_SERVICE_ID;
@State
protected ListLinkHandler tabHandler;
@State
protected String channelName;

View File

@ -27,9 +27,10 @@ public final class ChannelTabHelper {
case ChannelTabs.SHORTS:
case ChannelTabs.LIVESTREAMS:
return true;
}
default:
return false;
}
}
/**
* @param tab the channel tab link handler to check
@ -61,9 +62,10 @@ public final class ChannelTabHelper {
return R.string.show_channel_tabs_playlists;
case ChannelTabs.ALBUMS:
return R.string.show_channel_tabs_albums;
}
default:
return -1;
}
}
@StringRes
public static int getTranslationKey(final String tab) {
@ -82,9 +84,10 @@ 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;
}
}
public static boolean showChannelTab(final Context context,
final SharedPreferences sharedPreferences,