mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
Fix initial user rating setting
This commit is contained in:
parent
221ee4d3c9
commit
77a3b90b4e
1 changed files with 5 additions and 3 deletions
|
|
@ -61,11 +61,13 @@ public class RatingDialog extends DialogFragment {
|
||||||
|
|
||||||
private void setRating() {
|
private void setRating() {
|
||||||
if (ratingViewModel.getSong() != null) {
|
if (ratingViewModel.getSong() != null) {
|
||||||
ratingViewModel.getLiveSong().observe(getViewLifecycleOwner(), song -> bind.ratingBar.setRating(song.getUserRating()));
|
ratingViewModel.getLiveSong().observe(this, song -> {
|
||||||
|
bind.ratingBar.setRating(song.getUserRating() != null ? song.getUserRating() : 0);
|
||||||
|
});
|
||||||
} else if (ratingViewModel.getAlbum() != null) {
|
} else if (ratingViewModel.getAlbum() != null) {
|
||||||
ratingViewModel.getLiveAlbum().observe(getViewLifecycleOwner(), album -> bind.ratingBar.setRating(/*album.getRating()*/ 0));
|
ratingViewModel.getLiveAlbum().observe(this, album -> bind.ratingBar.setRating(/*album.getRating()*/ 0));
|
||||||
} else if (ratingViewModel.getArtist() != null) {
|
} else if (ratingViewModel.getArtist() != null) {
|
||||||
ratingViewModel.getLiveArtist().observe(getViewLifecycleOwner(), artist -> bind.ratingBar.setRating(/*artist.getRating()*/ 0));
|
ratingViewModel.getLiveArtist().observe(this, artist -> bind.ratingBar.setRating(/*artist.getRating()*/ 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue