mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
build: change of package name
This commit is contained in:
parent
49afdbe4eb
commit
b76a38cb30
274 changed files with 1981 additions and 2161 deletions
|
|
@ -0,0 +1,31 @@
|
|||
package com.cappielloantonio.tempo.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.cappielloantonio.tempo.repository.SongRepository;
|
||||
import com.cappielloantonio.tempo.subsonic.models.Child;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class StarredSyncViewModel extends AndroidViewModel {
|
||||
private final SongRepository songRepository;
|
||||
|
||||
private final MutableLiveData<List<Child>> starredTracks = new MutableLiveData<>(null);
|
||||
|
||||
public StarredSyncViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository();
|
||||
}
|
||||
|
||||
public LiveData<List<Child>> getStarredTracks(LifecycleOwner owner) {
|
||||
songRepository.getStarredSongs(false, -1).observe(owner, starredTracks::postValue);
|
||||
return starredTracks;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue