mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-03 02:41:40 +00:00
Fix downloaded item implementation
This commit is contained in:
parent
93d61be594
commit
b24903fd47
9 changed files with 25 additions and 22 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue