From 025a44b6297f85c9ac81db6e889d2d409b4e58b1 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Oct 2017 20:45:16 +0200 Subject: [PATCH] fix channel title for new tabs --- .../fragments/list/channel/ChannelFragment.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index f98f8c36a..61a97e847 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -26,6 +26,7 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.database.subscription.SubscriptionEntity; import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.NewPipe; +import org.schabi.newpipe.extractor.UrlIdHandler; import org.schabi.newpipe.extractor.channel.ChannelInfo; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.fragments.list.BaseListInfoFragment; @@ -82,6 +83,20 @@ public class ChannelFragment extends BaseListInfoFragment { // LifeCycle //////////////////////////////////////////////////////////////////////////*/ + @Override + public void setUserVisibleHint(boolean isVisibleToUser) { + super.setUserVisibleHint(isVisibleToUser); + if(activity != null + && useAsFrontPage + && isVisibleToUser) { + try { + activity.getSupportActionBar().setTitle(currentInfo.name); + } catch (Exception e) { + onError(e); + } + } + } + @Override public void onAttach(Context context) { super.onAttach(context);