Fix downloaded item implementation

This commit is contained in:
CappielloAntonio committed 2021-08-11 12:11:14 +02:00
1 parent 93d61be594
commit b24903fd47
9 files changed
+25 -22

No files matched your search

@@ -92,7 +92,9 @@ public class AlbumPageFragment extends Fragment {
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_download_album:
DownloadUtil.getDownloadTracker(requireContext()).toggleDownload(albumPageViewModel.getAlbumSongLiveList().getValue());
albumPageViewModel.getAlbumSongLiveList().observe(requireActivity(), songs -> {
DownloadUtil.getDownloadTracker(requireContext()).toggleDownload(songs);
});
return true;
default:
break;
@@ -178,7 +178,7 @@ public class SongBottomSheetDialog extends BottomSheetDialogFragment implements
}
private void initDownloadedUI() {
if (song.isOffline()) {
if (DownloadUtil.getDownloadTracker(requireContext()).isDownloaded(song)) {
download.setText("Remove");
} else {
download.setText("Download");