mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Add favorite view
This commit is contained in:
parent
ae23d268cd
commit
01bdbf49b2
52 changed files with 1064 additions and 317 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package com.cappielloantonio.play.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
|
@ -20,6 +19,7 @@ public class HomeViewModel extends AndroidViewModel {
|
|||
private LiveData<List<Song>> recentlyPlayedSongSample;
|
||||
private LiveData<List<Song>> recentlyAddedSongSample;
|
||||
private LiveData<List<Song>> mostPlayedSongSample;
|
||||
private LiveData<List<Song>> favoritesSongSample;
|
||||
private List<Integer> years;
|
||||
|
||||
public HomeViewModel(@NonNull Application application) {
|
||||
|
|
@ -31,6 +31,7 @@ public class HomeViewModel extends AndroidViewModel {
|
|||
recentlyPlayedSongSample = songRepository.getListLiveRecentlyPlayedSampleSong(20);
|
||||
recentlyAddedSongSample = songRepository.getListLiveRecentlyAddedSampleSong(20);
|
||||
mostPlayedSongSample = songRepository.getListLiveMostPlayedSampleSong(20);
|
||||
favoritesSongSample = songRepository.getListLiveFavoritesSampleSong(20);
|
||||
years = songRepository.getYearList();
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +57,10 @@ public class HomeViewModel extends AndroidViewModel {
|
|||
}
|
||||
|
||||
public List<Integer> getYearList() {
|
||||
Log.d(TAG, "getYearList: " + years.toString());
|
||||
return years;
|
||||
}
|
||||
|
||||
public LiveData<List<Song>> getFavorites() {
|
||||
return favoritesSongSample;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue