1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01: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);
if (ChannelTabHelper.showChannelTab(context, preferences, tab)) {
tabAdapter.addFragment(
ChannelTabFragment.getInstance(serviceId, linkHandler),
ChannelTabFragment.getInstance(serviceId, linkHandler, name),
context.getString(ChannelTabHelper.getTranslationKey(tab)));
}
}

View File

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