mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-02 07:23:36 +00:00
Added download UI in home screen
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user