Skip to content

Migrate playlist fragment to Jetpack Compose #11259

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

Open
wants to merge 72 commits into
base: refactor
Choose a base branch
from

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Jul 10, 2024

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Rewrite the playlist fragment using Jetpack Compose. As part of this change, composable functions for the stream views (list, grid, card) were added as well for use in future refactoring.
  • Display a dropdown menu instead of a dialog when long-clicking a stream.
  • Handle the playlist stream loading functionality using the Paging library and a view model.

Before/After Screenshots/Screen Record

Screen_recording_20240710_085704.mp4

Fixes the following issue(s)

  • Fixes #

Relies on the following changes

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/giant PRs with more than 750 changed lines label Jul 10, 2024
@Isira-Seneviratne Isira-Seneviratne changed the base branch from dev to refactor July 10, 2024 03:37
@Isira-Seneviratne Isira-Seneviratne force-pushed the Playlist-Compose branch 4 times, most recently from 64bdabb to b6751c2 Compare July 16, 2024 13:58
@Isira-Seneviratne Isira-Seneviratne force-pushed the Playlist-Compose branch 5 times, most recently from d9a06a8 to 8049fa5 Compare July 22, 2024 10:36

This comment was marked as outdated.

@TobiGr TobiGr added the GUI Issue is related to the graphical user interface label Sep 2, 2024
@ShareASmile ShareASmile added the rewrite Issues and PRs related to rewrite label Oct 5, 2024
# Conflicts:
#	app/build.gradle
#	app/src/main/java/org/schabi/newpipe/MainActivity.java
#	app/src/main/java/org/schabi/newpipe/error/ReCaptchaActivity.java
#	app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
#	app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.kt
#	app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java
#	app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt
#	app/src/main/java/org/schabi/newpipe/local/bookmark/BookmarkFragment.java
#	app/src/main/java/org/schabi/newpipe/paging/CommentsSource.kt
#	app/src/main/java/org/schabi/newpipe/ui/components/common/DescriptionText.kt
#	app/src/main/java/org/schabi/newpipe/ui/components/common/LoadingIndicator.kt
#	app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt
#	build.gradle
@ShareASmile ShareASmile added the playlist Anything to do with playlists in the app label Jan 21, 2025
@Isira-Seneviratne Isira-Seneviratne marked this pull request as ready for review April 6, 2025 01:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 19 out of 32 changed files in this pull request and generated no comments.

Files not reviewed (13)
  • app/build.gradle: Language not supported
  • app/src/androidTest/java/org/schabi/newpipe/database/DatabaseMigrationTest.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistRemoteDAO.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/local/playlist/RemotePlaylistManager.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/paging/PlaylistItemsSource.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/comment/Comment.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/comment/CommentRepliesHeader.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/comment/CommentSection.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/common/DescriptionText.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/common/IconButtonWithLabel.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/common/PlaybackControlButtons.kt: Language not supported
  • app/src/main/java/org/schabi/newpipe/ui/components/items/ItemList.kt: Language not supported
Comments suppressed due to low confidence (4)

app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java:608

  • Ensure that the target Java version supports pattern matching for instanceof to avoid compilation issues.
if (!(obj instanceof PlaylistTab other)) {

app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java:195

  • Verify that the MenuProvider is automatically removed when using a lifecycle owner; if not, consider reinstituting a manual removal in onDestroy().
activity.addMenuProvider(menuProvider, getViewLifecycleOwner());

app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java:84

  • Confirm that PlaylistScreenInfo supplies all the required fields formerly provided by PlaylistInfo, and update any relevant documentation if necessary.
public PlaylistRemoteEntity(final PlaylistScreenInfo info) {

app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistRemoteDAO.java:1

  • Ensure that removal of the PlaylistRemoteDAO file is intentional and that all references to this DAO have been removed or migrated.
package org.schabi.newpipe.database.playlist.dao;

@Isira-Seneviratne Isira-Seneviratne requested a review from TobiGr April 6, 2025 03:10
# Conflicts:
#	app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistRemoteDAO.java
#	app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java
#	app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java
#	app/src/main/java/org/schabi/newpipe/local/playlist/RemotePlaylistManager.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issue is related to the graphical user interface playlist Anything to do with playlists in the app rewrite Issues and PRs related to rewrite size/giant PRs with more than 750 changed lines
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants