mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Fix some lint issues in viewModel
This commit is contained in:
parent
589c3289d4
commit
984003ccd4
25 changed files with 76 additions and 149 deletions
|
|
@ -17,10 +17,10 @@ import java.util.List;
|
|||
public class PlayerBottomSheetViewModel extends AndroidViewModel {
|
||||
private static final String TAG = "PlayerBottomSheetViewModel";
|
||||
|
||||
private SongRepository songRepository;
|
||||
private QueueRepository queueRepository;
|
||||
private final SongRepository songRepository;
|
||||
private final QueueRepository queueRepository;
|
||||
|
||||
private LiveData<List<Queue>> queueSong;
|
||||
private final LiveData<List<Queue>> queueSong;
|
||||
|
||||
public PlayerBottomSheetViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
|
@ -43,12 +43,14 @@ public class PlayerBottomSheetViewModel extends AndroidViewModel {
|
|||
public void setFavorite() {
|
||||
Song song = MusicPlayerRemote.getCurrentSong();
|
||||
|
||||
if (song.isFavorite()) {
|
||||
songRepository.unstar(song.getId());
|
||||
song.setFavorite(false);
|
||||
} else {
|
||||
songRepository.star(song.getId());
|
||||
song.setFavorite(true);
|
||||
if (song != null) {
|
||||
if (song.isFavorite()) {
|
||||
songRepository.unstar(song.getId());
|
||||
song.setFavorite(false);
|
||||
} else {
|
||||
songRepository.star(song.getId());
|
||||
song.setFavorite(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue