mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Added download UI in home screen
This commit is contained in:
parent
e0569c3901
commit
bf70863f84
8 changed files with 109 additions and 3 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package com.cappielloantonio.play.repository;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
|
|
@ -33,6 +32,8 @@ public class SongRepository {
|
|||
private LiveData<List<Song>> listLiveSongByYear;
|
||||
private LiveData<List<Song>> listLiveSampleFavoritesSong;
|
||||
private LiveData<List<Song>> listLiveFavoritesSong;
|
||||
private LiveData<List<Song>> listLiveSampleDownloadedSong;
|
||||
private LiveData<List<Song>> listLiveDownloadedSong;
|
||||
|
||||
public SongRepository(Application application) {
|
||||
AppDatabase database = AppDatabase.getInstance(application);
|
||||
|
|
@ -314,6 +315,16 @@ public class SongRepository {
|
|||
return listLiveFavoritesSong;
|
||||
}
|
||||
|
||||
public LiveData<List<Song>> getListLiveDownloadedSampleSong(int number) {
|
||||
listLiveSampleDownloadedSong = songDao.getDownloadedSongSample(number);
|
||||
return listLiveSampleDownloadedSong;
|
||||
}
|
||||
|
||||
public LiveData<List<Song>> getListLiveDownloadedSong() {
|
||||
listLiveDownloadedSong = songDao.getDownloadedSong();
|
||||
return listLiveDownloadedSong;
|
||||
}
|
||||
|
||||
public void insertAll(ArrayList<Song> songs) {
|
||||
InsertAllThreadSafe insertAll = new InsertAllThreadSafe(songDao, songGenreCrossDao, songs);
|
||||
Thread thread = new Thread(insertAll);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue