mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
refactor: Rename methods and variables
This commit is contained in:
parent
f74813ef69
commit
e1c5a60805
8 changed files with 31 additions and 38 deletions
|
|
@ -8,20 +8,20 @@ import java.util.Objects;
|
|||
|
||||
public class PlaybackViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<String> currentMediaId = new MutableLiveData<>(null);
|
||||
private final MutableLiveData<String> currentSongId = new MutableLiveData<>(null);
|
||||
private final MutableLiveData<Boolean> isPlaying = new MutableLiveData<>(false);
|
||||
|
||||
public LiveData<String> getCurrentMediaId() {
|
||||
return currentMediaId;
|
||||
public LiveData<String> getCurrentSongId() {
|
||||
return currentSongId;
|
||||
}
|
||||
|
||||
public LiveData<Boolean> getIsPlaying() {
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
public void update(String mediaId, boolean playing) {
|
||||
if (!Objects.equals(currentMediaId.getValue(), mediaId)) {
|
||||
currentMediaId.postValue(mediaId);
|
||||
public void update(String songId, boolean playing) {
|
||||
if (!Objects.equals(currentSongId.getValue(), songId)) {
|
||||
currentSongId.postValue(songId);
|
||||
}
|
||||
if (!Objects.equals(isPlaying.getValue(), playing)) {
|
||||
isPlaying.postValue(playing);
|
||||
|
|
@ -29,7 +29,7 @@ public class PlaybackViewModel extends ViewModel {
|
|||
}
|
||||
|
||||
public void clear() {
|
||||
currentMediaId.postValue(null);
|
||||
currentSongId.postValue(null);
|
||||
isPlaying.postValue(false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue