-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for tabs #3201
Add support for tabs #3201
Conversation
I am not sure it is a good idea to use those bubbles on the bottom to switch to different tabs. I think a pager like in the MainActivity would suit better, since in the future we could add new tabs for channels (e.g. related/suggested channels, channel description, ...), and having a small label for every tab would make things more clear and easily-accessible to the user imo. |
@Stypox: I agree. What exactly do you mean with 'a small label' though? Just the name of the tab (e.g. 'Videos' or 'Popular tracks')? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach is ok, in my opinion
app/src/main/java/org/schabi/newpipe/fragments/detail/ChannelDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/ChannelDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/ChannelDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelTabFragment.java
Outdated
Show resolved
Hide resolved
Yeah ;-) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I found this error |
I updated the screenshots and test APK. |
Would you please rename the package for adjacent installation with other apks? |
Rebase because it will also include fixed feed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid duplicates next time. Otherwise you're ordering community to translate something they already translated, we should not do that.
@@ -27,7 +27,7 @@ class SubscriptionManager(context: Context) { | |||
|
|||
database.runInTransaction { | |||
infoList.forEachIndexed { index, info -> | |||
feedDatabaseManager.upsertAll(listEntities[index].uid, info.relatedItems) | |||
feedDatabaseManager.upsertAll(listEntities[index].uid, info.tabs[0].relatedItems as List<StreamInfoItem>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better solution for this?
@opusforlife2 and @B0pol: I just rebased and updated the APK. |
@@ -39,9 +32,9 @@ public void fetch() { | |||
ExtractorHelper.getChannelInfo(this.serviceId, this.baseUrl, false) | |||
.subscribeOn(Schedulers.io()) | |||
.observeOn(AndroidSchedulers.mainThread()) | |||
.subscribe(getHeadListObserver()); | |||
.subscribe((Consumer<? super ChannelInfo>) getHeadListObserver()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I did this part correctly and I'm not sure what this even is supposed to do, though I don't think it breaks anything when I remove it.
@TobiGr: I think this PR is almost finished now. I highlighted 2 issues above, plus I need to make the playlist controls not sticky. @B0pol also discovered some SoundCloud issue, where it sometimes stops working completely for a few minutes, which I've reproduced once, but I'm not sure what causes it. |
Another bug found by @B0pol: when a channel only has one tab (i.e. media.ccc.de or PeerTube) and you press back, it crashes. Edit: fixed. |
Something is wrong. The feed update process is broken. It doesn't load even a single one successfully. Tapping on Report doesn't even show the errors. It just closes the app. I'm not sure if that's caused by this PR or mauricio's code. |
@opusforlife2: I could confirm that, however it shows the errors for me. I'll look into that. |
@opusforlife2: I fixed your issue and rebased it (again). I'll upload the new APK in a minute. |
Confirmed fixed. Edit: Wow! Channel loading is super fast. Placebo or your code? |
Another bug, but it is also present in cool-student's PR. When you open the app through a link from another app, the name of the app "Newpipe tabs" flashes for a moment at the place where the resolution drop down is. For his PR, it's "Newpipe notification", naturally. This doesn't happen in the release apk. Which means it's something in the dev branch causing the issue. |
@opusforlife2: Please just create a new issue for that as that isn't caused by this PR. |
That... is a very good point. Not sure what I was thinking. Brain fart. |
Error when switching tabs on a SoundCloud user page. Also, why does Newpipe lose the backstack when you open the error report page? Isn't that a bug? Exception
Crash log
|
@opusforlife2: I can't reproduce that error. About the backstack: I've no idea. I had code related to that inherited from the VideoDetailFragment, but that seemed to cause crashes here, so I removed that code, which seemed to work. |
Keep opening some User pages. You'll eventually hit it. I originally got it with an unofficial Daft Punk page, but then it stopped happening. I thought it was a one off, but then it happened here. What basically happens is that Newpipe is either able to load the tabs properly, in which case the error is unlikely to appear at all. But if it takes time to load the first tab, chances are that one of the other ones will give the error. For example, when I hit the error with the Eminem page, the Tracks tab was empty. But when I opened it again a few times, Tracks was populated. |
@opusforlife2 for the backstack: that's not something that can be prevented, I think. When the app crashes... it crashes. The Android is instructed to call a function inside of the app to handle the information about the crash, but everything has already been destroyed. |
@Stypox I'm not talking about the case where the app crashes and then automatically shows the error page. I'm talking about when you're happily browsing, then you see an error at the bottom, which you can choose not to open and continue browsing without any issue. But if you open it, you lose the backstack. I don't see why that should be the case. Maybe there's a way to code the page so that if it is opened manually by the user, the backstack shouldn't be discarded? Also, the button being called "Report" is a bit misleading. It should be called "View" instead. You get the option to report the error only after viewing it. |
When opening a playlist on YouTube from the playlists tab and then pressing the back button to return to the tab, it opens on the video tab. While the scrolling position of the playlists tab is preserved so switching back to it doesn't cause any issues, the expected behaviour would be to return to the playlist tab immediately. |
@NicTanghe Follow this for playlists in channels. |
Does this anly work for playlists with channels own videos or also playlists with others videos? |
@NicTanghe Probably the channel's own playlists. Can't remember for sure. |
What happens with this PR? |
Curious about the PR as well, checked if there were issues filed for it and found this, not sure if any things come from it. |
any hope for this to be merged |
Is the apk still updated? |
Not at all, this PR was closed and this work has been abandoned. |
@TiA4f8R why?, isn't necessary to add support for tabs ? |
Yes it is, since there is an issue open about it which has received endorsements from devs. But nobody is working on this at the moment and the original creator of this PR dropped his work. If somebody wants to work on this, contributions are well accepted. |
Currently it looks like the following:
You could download a test APK here.
To do:
though I've no idea how to do that as a tab could contain both streams and playlistsjust for the stream-only tabs)Fixes #3237
Also see TeamNewPipe/NewPipeExtractor#279.