mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Implementation of playlist page visualization
This commit is contained in:
parent
95bcbb0f61
commit
051ba23b58
5 changed files with 35 additions and 17 deletions
|
|
@ -5,38 +5,32 @@ import android.app.Application;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.repository.PlaylistRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PlaylistPageViewModel extends AndroidViewModel {
|
||||
private static final String TAG = "PlaylistPageViewModel";
|
||||
private PlaylistRepository playlistRepository;
|
||||
|
||||
private SongRepository songRepository;
|
||||
|
||||
private LiveData<List<Song>> songLiveList;
|
||||
private MutableLiveData<List<Song>> songLiveList = new MutableLiveData<>();
|
||||
|
||||
private Playlist playlist;
|
||||
|
||||
public PlaylistPageViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository(application);
|
||||
playlistRepository = new PlaylistRepository(application);
|
||||
}
|
||||
|
||||
public LiveData<List<Song>> getPlaylistSongLiveList() {
|
||||
// songLiveList = songRepository.getPlaylistLiveSong(playlist.getId());
|
||||
public MutableLiveData<List<Song>> getPlaylistSongLiveList() {
|
||||
songLiveList = playlistRepository.getPlaylistSongs(playlist.getId());
|
||||
return songLiveList;
|
||||
}
|
||||
|
||||
public List<Song> getPlaylistSongList() {
|
||||
// return songRepository.getPlaylistSong(playlist.getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
public Playlist getPlaylist() {
|
||||
return playlist;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue