-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Make long-press menu consistent across views #2368
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
Conversation
Also made the code that creates the menus consistent across files.
VideoDetailFragment already borrows a consistant menu from the stream list it holds.
They were exactly the same as the base class function
Inverted unsubscribe with share, since share has always been put after content-specific actions.
start_here_on_background has the same meaning start_here_on_main is now unused, but I left it there so that if it ever becomes useful again, it is ready to be used.
I addressed the duplicate |
…alls. `resumePlayback`'s value is `false` when the video is enqueued, `true` otherwise. Also make the use of getContext() and getActivity() more consistant.
There are no popup entries anymore when the long-pressed stream is audio-only. I had to replace the |
you could work with enums: https://schneide.blog/2010/12/13/avoid-switch-use-enum/ |
Common actions and labels are now in a unique enum: StreamDialogEntry If an action is not common to every long-press menu (e.g. delete) a custom action has to be provided using e.g. delete.setAction(...)
@Redirion fixed. Is it ok now? I did my best, and I really love Java enums! 😍 showStreamDialog Btw 9df27f4 is just to increase safety for any potential future user/reader of StreamDialogEntry code. If you think I should remove it, tell me :-) |
Also, I found a bug: the app crashes when the popup player is closed while starting. I don't know if this problem is caused by my code. |
To improve readability
It looks beautifully! You have some unused imports in BaseListFragment that could be cleaned up. I will test the code later (in about 8 hours). |
@Redirion I added a test APK to the description |
Ok, fixed the crash. The problem was caused by the recent resume playback pr #2288: the popup's BasePlayer tried to re-init when closing, since the loaded-listener was called both on video loading completion and when a not-yet-loaded popup is closed. @nv95 can you please confirm that what I did in 7c9ef58 was ok? |
I tried the Apk and all seem to be good for me |
@Stypox I'll look on this on weekends |
@Stypox I was try it and looks like everything is ok |
I have used it on daily basis since you provided the apk and only had two unrelated crashes. This should be fine for merge. |
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 code is a beauty ❤️
I don’t understand why |
I did not delete either of them. They are still there and are being used (see the apk in release 0.17.0). I only deleted |
Yes, I removed "start playing here" because it seemed mostly useless. See above. About the differencies about arrows... I don't know why that happens, will look into it in a week (after vacation) |
The order of the items in the stream long-press menu should be the same in every view (playlist, search, info...), so that the user can subconsciously memorize it, without having to read the same info over and over again. Also, I think consistency is a good thing. See #2354 for more info.
I fixed the menu so that it is the same across the app, and I chose this order:
The subscription long-press menu (in the local subscription list) was also modified to comply with the above order: it is now
unsubscribe; share;
instead ofshare; unsubcribe;
.I decided to remove the
new-on-main-player
option since it was mostly useless. The other play options are useful to (for example) enqueue while carrying on browsing flawlessly. But opening the main player interrupts what the user was doing anyway. And, from a time point of view, one could open the stream details and open the main player in roughly the same time it would take to long-press and then click.direct_on_background
) and "Start playing in the background" (start_here_on_background
). So thedirect_on_background
string should be removed, along withstart_here_on_main
which is no longer used (as explained above).Testing APK: app-debug.zip
Fixes #1142
Closes #2354