mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-22 16:10:31 +00:00
Fix some code smells
This commit is contained in:
parent
a1e8b9be4e
commit
371f986773
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user