1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-01-03 14:00:32 +00:00

fix: channel tab title not being set

This commit is contained in:
ThetaDev 2022-11-29 19:25:35 +01:00 committed by Stypox
parent 4357a34339
commit be548dcb52
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
2 changed files with 8 additions and 2 deletions

View File

@ -297,7 +297,7 @@ public class ChannelFragment extends BaseStateFragment<ChannelInfo>
final String tab = linkHandler.getContentFilters().get(0); final String tab = linkHandler.getContentFilters().get(0);
if (ChannelTabHelper.showChannelTab(context, preferences, tab)) { if (ChannelTabHelper.showChannelTab(context, preferences, tab)) {
tabAdapter.addFragment( tabAdapter.addFragment(
ChannelTabFragment.getInstance(serviceId, linkHandler), ChannelTabFragment.getInstance(serviceId, linkHandler, name),
context.getString(ChannelTabHelper.getTranslationKey(tab))); context.getString(ChannelTabHelper.getTranslationKey(tab)));
} }
} }

View File

@ -29,11 +29,16 @@ public class ChannelTabFragment extends BaseListInfoFragment<InfoItem, ChannelTa
@State @State
protected ListLinkHandler tabHandler; protected ListLinkHandler tabHandler;
@State
protected String channelName;
public static ChannelTabFragment getInstance(final int serviceId, public static ChannelTabFragment getInstance(final int serviceId,
final ListLinkHandler tabHandler) { final ListLinkHandler tabHandler,
final String channelName) {
final ChannelTabFragment instance = new ChannelTabFragment(); final ChannelTabFragment instance = new ChannelTabFragment();
instance.serviceId = serviceId; instance.serviceId = serviceId;
instance.tabHandler = tabHandler; instance.tabHandler = tabHandler;
instance.channelName = channelName;
return instance; return instance;
} }
@ -70,5 +75,6 @@ public class ChannelTabFragment extends BaseListInfoFragment<InfoItem, ChannelTa
@Override @Override
public void setTitle(final String title) { public void setTitle(final String title) {
super.setTitle(channelName);
} }
} }