mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-11 08:21:06 -07: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,41 @@
|
|||
package com.cappielloantonio.tempo.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
||||
import com.cappielloantonio.tempo.repository.AlbumRepository;
|
||||
import com.cappielloantonio.tempo.subsonic.models.ArtistID3;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ArtistBottomSheetViewModel extends AndroidViewModel {
|
||||
private final AlbumRepository albumRepository;
|
||||
|
||||
private ArtistID3 artist;
|
||||
|
||||
public ArtistBottomSheetViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
albumRepository = new AlbumRepository();
|
||||
}
|
||||
|
||||
public ArtistID3 getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
public void setArtist(ArtistID3 artist) {
|
||||
this.artist = artist;
|
||||
}
|
||||
|
||||
public void setFavorite() {
|
||||
if (artist.getStarred() != null) {
|
||||
albumRepository.unstar(artist.getId());
|
||||
artist.setStarred(null);
|
||||
} else {
|
||||
albumRepository.star(artist.getId());
|
||||
artist.setStarred(new Date());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue