Skip to content

Improve/Fix primaryControls layout in player#12714

Merged
Stypox merged 5 commits intoTeamNewPipe:devfrom
litetex:properly-layout-player-topbar
Oct 21, 2025
Merged

Improve/Fix primaryControls layout in player#12714
Stypox merged 5 commits intoTeamNewPipe:devfrom
litetex:properly-layout-player-topbar

Conversation

@litetex
Copy link
Copy Markdown
Member

@litetex litetex commented Oct 17, 2025

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

Before/After Screenshots/Screen Record

About the Popup Player

The popup player is still broken but it was broken before (basically since the introduction of audioTrackTextView a few years ago)
grafik

I tried a few quick/dirty fixes - like limiting the maxWidth of audioTrackTextView - however the results were worse than before so I aborted doing any changes there for now.

This can likely only be fixed with a major rework how the topControls are handled in the player.
There should be different fragments, one for the main player (that basically represents the current layout) and one for popup (where everything is next to each other). This way the spacing can be done correctly. It would also make the player UI a lot cleaner.

Maybe we can also sit this problem out / it's fixed with refactor/NewPlayer...

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

Otherwise it constantly switches the attributes which makes (re) viewing changes next to impossible
This fulfills the following:
* both should never push content outside of the view
* there should be no wasted space
* `audioTrackTextView` is always aligned to the right
* both should grow equally but also respect their respective contents size first

Caveats:
* Currently the layout weight is distributed using "NestedWeights" which require a widget to be measured twice. According to Android Studio this might cause an exponential performane impact, however there is currently just a single nested component so the effect should be not noticeable
@github-actions github-actions Bot added the size/medium PRs with less than 250 changed lines label Oct 17, 2025
@litetex litetex marked this pull request as ready for review October 17, 2025 19:26
@litetex litetex changed the title Properly layout player topbar Improve primaryControls layout in player Oct 17, 2025
@litetex litetex changed the title Improve primaryControls layout in player Improve/Fix primaryControls layout in player Oct 17, 2025
@litetex litetex added the player Issues related to any player (main, popup and background) label Oct 17, 2025
@Stypox
Copy link
Copy Markdown
Member

Stypox commented Oct 18, 2025

Thanks!

The popup player is still broken but it was broken before (basically since the introduction of audioTrackTextView a few years ago)

Yeah it's the same change that also broke the main player, and #12699 was the first attempt to fix it.

I tried a few quick/dirty fixes - like limiting the maxWidth of audioTrackTextView - however the results were worse than before so I aborted doing any changes there for now.

Doesn't just setting the max width of audioTrackTextView to something very small (e.g. 48dp) fix it? Or are there more layout problems then?

@litetex
Copy link
Copy Markdown
Member Author

litetex commented Oct 18, 2025

Doesn't just setting the max width of audioTrackTextView to something very small (e.g. 48dp) fix it? Or are there more layout problems then?

Nope, because:

  1. When the popup player is small it still grows and pushes the full screen out of the window
    grafik
  2. When the popup player is large it stops growing, despite having space left
    grafik

I also tried things like match_parent or 0dp as a width but this doesn't seem to work either.

@Stypox
Copy link
Copy Markdown
Member

Stypox commented Oct 19, 2025

Yeah that's what I'd have expected, but for now it's still better than having a huge button always pushing the other buttons away

@litetex
Copy link
Copy Markdown
Member Author

litetex commented Oct 20, 2025

Yeah that's what I'd have expected, but for now it's still better than having a huge button always pushing the other buttons away

Anyway can we get this fix reviewed/merged so that we have at least a working main player.
I can make a separate PR that "fixes" the popup player.

PR with a maxWidth set for popup player: #12729

Copy link
Copy Markdown
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.

Code LGTM. I tested and it seems to work as expected. Thanks!

@Stypox Stypox merged commit ecd3e85 into TeamNewPipe:dev Oct 21, 2025
10 checks passed
@litetex litetex deleted the properly-layout-player-topbar branch October 21, 2025 17:52
@TobiGr TobiGr mentioned this pull request Dec 21, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

player Issues related to any player (main, popup and background) size/medium PRs with less than 250 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants