mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Adapters refactoring
This commit is contained in:
parent
18fae806a6
commit
ae23d268cd
34 changed files with 341 additions and 100 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package com.cappielloantonio.play.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
|
@ -19,6 +20,7 @@ public class HomeViewModel extends AndroidViewModel {
|
|||
private LiveData<List<Song>> recentlyPlayedSongSample;
|
||||
private LiveData<List<Song>> recentlyAddedSongSample;
|
||||
private LiveData<List<Song>> mostPlayedSongSample;
|
||||
private List<Integer> years;
|
||||
|
||||
public HomeViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
|
@ -29,6 +31,7 @@ public class HomeViewModel extends AndroidViewModel {
|
|||
recentlyPlayedSongSample = songRepository.getListLiveRecentlyPlayedSampleSong(20);
|
||||
recentlyAddedSongSample = songRepository.getListLiveRecentlyAddedSampleSong(20);
|
||||
mostPlayedSongSample = songRepository.getListLiveMostPlayedSampleSong(20);
|
||||
years = songRepository.getYearList();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -51,4 +54,9 @@ public class HomeViewModel extends AndroidViewModel {
|
|||
public LiveData<List<Song>> getMostPlayedSongList() {
|
||||
return mostPlayedSongSample;
|
||||
}
|
||||
|
||||
public List<Integer> getYearList() {
|
||||
Log.d(TAG, "getYearList: " + years.toString());
|
||||
return years;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue