-
-
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
Redesigned long press menu #12032
base: refactor
Are you sure you want to change the base?
Redesigned long press menu #12032
Conversation
Implement content preview
|
} | ||
} | ||
|
||
Column { |
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.
FlowRow
could be used here instead.
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.
Mmmh, that's what I was using in the beginning, but I don't think you can have a FlowRow with a maximum amount of items per row, but also have an item that weighs more than the others (i.e. the header). Also, I wanted the buttons to expand as much as possible, to not waste any space.
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 linked documentation mentions a maxItemsInEachRow
attribute.
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 know, but I need the header to be counted as if it were 4 items. And then if more items can fit alongside the header, I need those to be aligned well. If you want to give it a try with FlowRow go ahead, but I couldn't make it do what I want.
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 was able to make the needed changes using FlowRow (it might need to be tweaked a bit).
Could you grant write access? I can't push the commit to this branch.
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.
Mmmh, I should have given you write access to the NewPipe repository (or maybe you had it already), which should be enough according to what GitHub says:
[...] users with write access to TeamNewPipe/NewPipe can add new commits to your long-press-menu branch.
Anyways, thank you for the patch! I haven't tested it yet (will do tomorrow) but from a brief look it seems like the fact that the header is always 66% of the width means the buttons in the first row won't be aligned like the ones below. Also, the buttons should fill as much horizontal space as possible, so misclicks can still be caught, and there might also be more space for the button label text. One final (minor) thing is that I wanted the layout to scale well just based on the available space, not specifically based on whether the device is landscape or portrait, so the header sizing in your patch does not fulfill this requirement.
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.
One final (minor) thing is that I wanted the layout to scale well just based on the available space, not specifically based on whether the device is landscape or portrait, so the header sizing in your patch does not fulfill this requirement.
That can be implemented using currentWindowAdaptiveInfo().windowSizeClass
, like in the determineItemViewMode()
method.
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.
Sure, but what's bad about using BoxWithConstraints and measuring the actual available space?
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.
Good point, though using it results in the IDE checking if the constraints are actually used. Also, it results in a lot more complexity than using FlowRow.
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.
You are right that it is indeed much more complex, so we might want to change the requirements. In the meantime I will add more documentation on the requirements (so people reading the code know why it was made like that).
What is it?
Description of the changes in your PR
This PR replaces
InfoItemDialog
with a JetpackCompose-based bottom sheet menu. This new menu is supposed to replace all item long press menus across the app, i.e. streams, playlists, channels. The menu contains more details than before about the stream/playlist/channel that was clicked, laid out in a (imo) nice design.Please provide feedback both on the code and on the UI, but please keep in mind the points below when suggesting an alternative layout. Note that the order of buttons is not yet finalized, and that at the moment the menu only works for streams.
Motivation and design goals
Some of these points arose after some discussions in the NewPipe Matrix channel
TODO
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