Skip to content
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

Introduce Jetpack Compose #10875

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

snaik20
Copy link
Contributor

@snaik20 snaik20 commented Mar 9, 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

This pull request integrates Jetpack Compose into NewPipe by:

  • Adding the necessary dependencies and setup.
  • This is part of the NewPipe rewrite and fulfills the requirement for the planned settings page redesign.
  • Introducing a Toolbar composable with theming that aligns with NewPipe's design.

Note:

Screenshot

NewPipe_Compose_Toolbar_Preview

Fixes the following issue(s)

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

@snaik20
Copy link
Contributor Author

snaik20 commented Mar 9, 2024

@AudricV, @theScrabi Let me know what you think about these changes. The colors are generated using Material theme builder and updated slightly by me to match toolbar and background colors (I did not have any design doc for NewPipe, so I have only tried to approximate by comparing with existing colors from styles.xml). Feel free to update any changes to match NewPipe design.

@snaik20 snaik20 mentioned this pull request Mar 9, 2024
5 tasks
@snaik20 snaik20 force-pushed the intro-jetpack-compose branch from a24b760 to 18251dc Compare March 9, 2024 22:05
@opusforlife2
Copy link
Collaborator

xD I eagerly downloaded this and then realised there's no visible difference for me to notice.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 26, 2024

I am unable to see any changes in colors on the phone. Our colors were generated using a Material Theme Builder, too. There is a chance that Google did minor changes on the color generation over the years.
It might be good to get an overview by seeing all the colors next to each other, similar to this.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

As a first introduction of Compose in the codebase this looks good, and will be merged as the first PR to start the rewrite. Thank you!

The search bar should be inside the toolbar, the navigation icon should be provided from the outside (since it e.g. might be the drawer instead of back), the spacing in the toolbar is a bit off. But we can fix these things later.

Did you use this color generator? Because the link you provided points to a documentation page. Anyway, even if the colors are not perfect, it's really easy to generate different ones later, so I wouldn't worry too much.

@opusforlife2 @TobiGr you won't be able to notice differences, since none of the app turned to using Compose and/or changed colors. This PR just adds Compose to the codebase and creates a toolbar component which you can preview from Android Studio ;-)

Yeah the colors look good (tested on #10876):

app/build.gradle Show resolved Hide resolved
@acrodemocide
Copy link

I've reviewed the code and downloaded the artifact for this build to test on my phone. I'll go through my typical testing as well as use it as I normally use the app over time to ensure that I don't see any issues. I'll report back soon on either issues I find or whether it is working as expected.

@Stypox
Copy link
Member

Stypox commented Mar 31, 2024

@acrodemocide this PR should not change anything at all, because it only adds the library but doesn't make any change to existing code. So, as I said above, there's nothing to test. (sorry for closing, pressed wrong button)

@Stypox Stypox closed this Mar 31, 2024
@Stypox Stypox reopened this Mar 31, 2024
@github-actions github-actions bot added the size/large PRs with less than 750 changed lines label Mar 31, 2024
@snaik20 snaik20 self-assigned this Mar 31, 2024
@snaik20
Copy link
Contributor Author

snaik20 commented Mar 31, 2024

As a first introduction of Compose in the codebase this looks good, and will be merged as the first PR to start the rewrite. Thank you!

Thanks for the review.

The search bar should be inside the toolbar, the navigation icon should be provided from the outside (since it e.g. might be the drawer instead of back), the spacing in the toolbar is a bit off. But we can fix these things later.

I had tried to get it inside the Toolbar, but it caused different layout issues inside the Toolbar. After looking it up online, this approach seems like standard for search bar. We can always revisit it in the future.

Did you use this color generator? Because the link you provided points to a documentation page.

Yes, this was the one.

Anyway, even if the colors are not perfect, it's really easy to generate different ones later, so I wouldn't worry too much. Yeah the colors look good (tested on #10876):

Sounds good, thanks

@opusforlife2
Copy link
Collaborator

I think you're supposed to rebase, not merge, so that the commit history is clean.

@wb9688
Copy link
Contributor

wb9688 commented Apr 24, 2024

I think you're supposed to rebase, not merge, so that the commit history is clean.

Exactly. I was about to say this as well.

@snaik20
Copy link
Contributor Author

snaik20 commented Apr 24, 2024

Ah, I didn't realize that the project prefers rebasing over merging. I understand the contribution guide states "you must rebase to update," but I wasn't aware that rebasing with git rebase would be a strict requirement over git merge.

I'm curious, is there a specific reason for this preference?

Here's why I generally prefer merging to rebasing when pushing to remote branches:

1. Preserves History: Merging keeps the original commit history intact, showing the branching point and how changes were integrated. Rebasing, on the other hand, rewrites history, making it harder to track the original development flow.

2. Avoids Force Push Issues: With merging, you don't need to force push, which can disrupt collaboration and invalidate review comments on platforms like Github. Force pushing rewrites history on the remote branch, potentially causing confusion and making it difficult to track feedback.

I'm happy to use rebasing if it's the project's strict preference.

Can we merge this PR? Are there any blockers? If the only issue is the branch name, can we discuss resolving it now?

@Stypox
Copy link
Member

Stypox commented Apr 25, 2024

Merge does not preserve history well, and makes it difficult to reason about the various commits, since the code that fixes the conflicts is not in the original commits but in the merge commit.

This pull request integrates Jetpack Compose into NewPipe by:
- Adding the necessary dependencies and setup.
- This is part of the NewPipe rewrite and fulfils the requirement for
  the planned settings page redesign.
- Introducing a Toolbar composable with theming that aligns with
  NewPipe's design.

Note:
- Theme colors are generated using the Material Theme builder (https://m3.material.io/styles/color/overview).
@snaik20 snaik20 force-pushed the intro-jetpack-compose branch from 8c3ac13 to 1af798b Compare May 12, 2024 22:24
Copy link

@Stypox Stypox changed the base branch from dev to refactor May 13, 2024 19:17
@Stypox Stypox merged commit d479f29 into TeamNewPipe:refactor May 13, 2024
6 of 7 checks passed
@snaik20 snaik20 deleted the intro-jetpack-compose branch May 13, 2024 20:45
@opusforlife2
Copy link
Collaborator

OH MAH GAWD IT HAS BEGUN. 🙌

@snaik20
Copy link
Contributor Author

snaik20 commented May 16, 2024

OH MAH GAWD IT HAS BEGUN. 🙌

Yupp. Although it is only merged to a temporary branch as of now. It will be available in releases only when it is moved into dev branch

@AudricV AudricV added the GUI Issue is related to the graphical user interface label Jul 4, 2024
@AudricV AudricV added the dependency Issues and PRs related to dependencies label Jul 4, 2024
@AudricV AudricV changed the title Introducing Jetpack Compose in NewPipe Introduce Jetpack Compose in NewPipe Jul 4, 2024
@AudricV AudricV changed the title Introduce Jetpack Compose in NewPipe Introduce Jetpack Compose Jul 4, 2024
@ShareASmile ShareASmile added the rewrite Issues and PRs related to rewrite label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Issues and PRs related to dependencies GUI Issue is related to the graphical user interface rewrite Issues and PRs related to rewrite size/large PRs with less than 750 changed lines
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Introduce Jetpack Compose for NewPipe UI
8 participants