Change PlaylistChooserDialog\PlaylistEditorDialog to require ArrayList of Songs

This allows for being able to provide an entire Album's worth of songs
in one API call.
This commit is contained in:
Matthew Simpson 2025-03-09 14:15:17 +00:00
parent 9cf62c8c0c
commit bfdeb0658b
No known key found for this signature in database
GPG key ID: 9291883D725C52C9
5 changed files with 25 additions and 20 deletions

View file

@ -39,6 +39,9 @@ import com.cappielloantonio.tempo.viewmodel.SongBottomSheetViewModel;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.Collections;
@UnstableApi
public class SongBottomSheetDialog extends BottomSheetDialogFragment implements View.OnClickListener {
private HomeViewModel homeViewModel;
@ -177,7 +180,7 @@ public class SongBottomSheetDialog extends BottomSheetDialogFragment implements
TextView addToPlaylist = view.findViewById(R.id.add_to_playlist_text_view);
addToPlaylist.setOnClickListener(v -> {
Bundle bundle = new Bundle();
bundle.putParcelable(Constants.TRACK_OBJECT, song);
bundle.putParcelableArrayList(Constants.TRACKS_OBJECT, new ArrayList<>(Collections.singletonList(song)));
PlaylistChooserDialog dialog = new PlaylistChooserDialog();
dialog.setArguments(bundle);