mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-03 19:01:39 +00:00
Implemented download service
This commit is contained in:
parent
f09d3b774d
commit
0e41cc20bd
9 changed files with 332 additions and 10 deletions
|
|
@ -28,6 +28,7 @@ import com.cappielloantonio.play.databinding.FragmentHomeBinding;
|
|||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.MappingUtil;
|
||||
import com.cappielloantonio.play.util.UIUtil;
|
||||
import com.cappielloantonio.play.viewmodel.HomeViewModel;
|
||||
|
||||
|
|
@ -254,9 +255,9 @@ public class HomeFragment extends Fragment {
|
|||
|
||||
dowanloadedMusicAdapter = new RecentMusicAdapter(activity, requireContext(), getChildFragmentManager());
|
||||
bind.downloadedTracksRecyclerView.setAdapter(dowanloadedMusicAdapter);
|
||||
homeViewModel.getDownloaded().observe(requireActivity(), songs -> {
|
||||
if(bind != null) bind.homeDownloadedTracksSector.setVisibility(!songs.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
dowanloadedMusicAdapter.setItems(songs);
|
||||
homeViewModel.getDownloaded().observe(requireActivity(), downloads -> {
|
||||
if(bind != null) bind.homeDownloadedTracksSector.setVisibility(!downloads.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
dowanloadedMusicAdapter.setItems(MappingUtil.mapDownload(downloads));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue