CappielloAntonio / tempo

An open source and lightweight music client for Subsonic, designed and built natively for Android.
GNU General Public License v3.0
1.06k stars 49 forks source link

feat: Add bottom sheet for grouped views in Download tab #61

Closed GallowsDove closed 1 year ago

GallowsDove commented 1 year ago

Why?

Main motivation is the ability to remove several items without having to search for the album/artist.

Problems with this

The implementation can be rather slow with large amount of songs in a group (assuming because a lot of data has to be parcelized?) it appears it was slow because I ran these two lines without even selecting Remove, I've fixed that.

List<MediaItem> mediaItems = MappingUtil.mapDownloads(songs);
List<Download> downloads = songs.stream().map(Download::new).collect(Collectors.toList());

I've chosen to do it like this to fully work offline, and to work properly with how groups are implemented. There might be optimizations to be made, please let me know what you think.

Status

Fully tested with my Navidrome instance, but might benefit from more testing

GallowsDove commented 1 year ago

@CappielloAntonio merged and tested with the latest changes, please let me know how we can proceed with this (if you don't think it's good then consider this a feature request and feel free to close the PR)

CappielloAntonio commented 1 year ago

Yes, I think I'll merge as soon as I get the Replay Gain options out of the way. I will probably make some further changes on what will be shown in the bottomSheet, on how long clicks are handled and on how the list to be inserted in the bundle is created, but all in all the code seems clear and clean to me.

CappielloAntonio commented 1 year ago

I merged the pull request and modified the bottomSheet layout and the long click appearance logic.