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
Contextual menu for multi selecting episodes #5130
Contextual menu for multi selecting episodes #5130
Conversation
Oh, I thought you would do the subscriptions screen, not the episodes screen :) I have not tried it yet but I skimmed the code. Some thoughts:
|
idk, it seems odd to have it has an option in the context menu. How about adding a 3-dot like button next to the play button. That is very common UI pattern. With this approach, we will be implementing 2 common patterns versus 1. It seems like a very good choice to me. Regarding the FAB. I think with our current design we should keep it. Current users are already familiar with it. And, it is better than having it at the top where users need to reach for it. If we're deciding whether to add a FAB, I would have been against it, as like you said, it is unnecessary with the action mode. But having an already implemented FAB. Why get rid of the work just to regress to a poorer UX? I vote to keep it. |
I think this will clutter the screen too much. Please use the long-press menu for now. Changing that later would be pretty easy, so I would rather go with as few muscle-memory breaking changes for now.
Okay 👍 I think it will be slightly harder to implement than the ActionMode but I agree :) |
After thinking it over, I agree that having it in the context menu wouldn't be such a bad idea. So let's do that. Thanks, it actually isn't too hard. I've already implemented it, and works it works nicely. |
@ByteHamster i am ready for you to review my latest commit. The multi-select is not working on FeedItemListFragment. If you approve of it, I will proceed with migrating the rest of the views that use episode multi-select. |
This makes it harder to modularize and test the code. I think it would be better to do it the other way around: Extract the common parts (like ActionBinding) to their own classes. Then these things can be included in all classes that need them. They can then also be tested independently of the UI. |
app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/view/EpisodeItemListRecyclerView.java
Outdated
Show resolved
Hide resolved
@@ -9,17 +9,17 @@ | |||
app:showAsAction="always"> | |||
<menu> | |||
<item android:id="@+id/sort_title_a_z" | |||
android:title="@string/sort_title_a_z"/> | |||
android:title="@string/sort_title_a_z"/> |
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.
Please don't reformat the file, unless you really need to change it. We don't have clear guidelines for xml formatting currently, so it should just be kept as it is.
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.
Still unrelated changes here :)
I'll take a look at the comments soon. Thanks for the reply. |
I'm downloading a bunch of 'debug' artifects to try out - let me know when I can/should do that for this PR. Eager to try it out :) |
I should have something ready soon. |
Hey @ByteHamster, |
Sorry, I can't check AntennaPod every day (it's done in my free time). Could you please clean up some of the code here? It contains a lot of commented code and changes to unrelated files. That would make it a lot easier to review. I just played around with it. It does feel pretty nice. There seems to be a problem though, where wrong episodes can get changed. Also, pressing the "Select all" button twice brings everything into a broken state that always affects all episodes, regardless of what you select. Other issues I found:
|
Ok that is fine. I'll go and send a new commit soon. |
I'll have a look at the colour later (probably over the weekend) |
@keunes have you had the chance to look at this PR yet? |
I was thinking maybe we could use the action button to indicate selection state. When an episode is not selected, just keep it empty. When an episode is selected, display a check mark (blue copy of the drawable). Then we don't have problems with the contrast when setting a backgroubd. Also, the action button still showing "download" could be confusing otherwise. |
Yeah that will work nicely. So should I proceed with porting it to the other screens (Queue, Downloads, ... etc.)? Let me know if you need any more changes, especially related to the architecture. |
@ByteHamster Actually, after looking at the code, I don't think the actionbutton can be changed easilty. I suggest hiding it while in multi select mode. I think we can make it work if we change the color. Maybe to a light gray for light theme and dark gray for dark theme. That is how it is usally done by other apps. It will be better UX. If you want to still do the checkmark approach. I can add a checkmark view to the EpisodeItemViewHolder. Would that be ok with you? |
I just removed 2 of the 3 lists that store which episodes are selected and also did a bit of cleanup. I think I am happy with the code structure now. Please have another look again to see if I overlooked something. |
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 just removed 2 of the 3 lists that store which episodes are selected and also did a bit of cleanup. I think I am happy with the code structure now. Please have another look again to see if I overlooked something.
@ByteHamster I looked at the code a bit, but haven't tested it. I didn't code it like that on a whim. This was the result of a lot of manual testing. Let's hope you didn't break anything. :) After I test it, i'll give you an update.
android:id="@+id/selectCheckBox" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
android:layout_weight="1" /> |
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'll remove it.
@@ -1,6 +1,12 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | |||
<item | |||
android:id="@+id/episode_actions" |
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 thought the name was amibiguous too. It was from the original author. Just wasn't sure if you would approve of the rename. I'll rename it as per suggestion.
android:visibility="gone" | ||
app:sdMainFabClosedSrc="@drawable/ic_fab_edit" | ||
app:sdOverlayLayout="@id/fabSDOverlay" /> | ||
</ScrollView> |
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.
Okay
app/src/main/java/de/danoeh/antennapod/view/EpisodeItemListRecyclerView.java
Outdated
Show resolved
Hide resolved
@ByteHamster Ok, i've reviewed your changes. And I am also happy with the code structure. Just added one last commit to remove the previous multi-select option. Now that we have implemented it for FeedItemListFragment. We just need to implement it for the rest of the screens that need episode multi select. I believe those are (at least those that currently have multi-select) Should we merge and close this PR or wait till we have it implemented for the rest of the screens? |
Yeah I just noticed a little problem before merging this. All screens (eg playback history) now show the multi-select context menu item, even if they don't support multi select. |
Ok, once we get this merged we can start work on implementing it for the other fragments.
I'll fix this today. |
…creens that use it.
Your most recent commit breaks long-pressing in select mode (for "select all above") |
Thanks :) |
My pleasure. Now to start on migrating the other screens to use this multi select. Any suggestions on how this should be done? The two other screens that use multi select are the QeueFragment and thd CompletedDownloadsFragment. I know the UI is about to under go major changes so I want to avoid doing work that will end up being thrown away anyway. The only screen I know for certain will not be changed is the Queue. Should i start with that? |
This pull request has been mentioned on AntennaPod Forum. There might be relevant details there: https://forum.antennapod.org/t/antennapod-2-4-release-notes/1300/1 |
This pull request has been mentioned on AntennaPod Forum. There might be relevant details there: https://forum.antennapod.org/t/antennapod-2-4-release-notes/1300/3 |
Here is a working build I did implementing your mockup: https://drive.google.com/file/d/1A0fMp7SemlpHHltod-x0MQsDRn9TZDwg/view
I'm not close to done, but I wanted to get your feedback on it before I proceed further.
What I added: