Improve/Fix primaryControls layout in player#12714
Conversation
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
This is done by the parent
|
Thanks!
Yeah it's the same change that also broke the main player, and #12699 was the first attempt to fix it.
Doesn't just setting the max width of |
|
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. PR with a maxWidth set for popup player: #12729 |
Stypox
left a comment
There was a problem hiding this comment.
Code LGTM. I tested and it seems to work as expected. Thanks!


What is it?
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

audioTrackTextViewa few years ago)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
topControlsare 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