Refactoring - Removed most of the click listeners from the adapters and moved them into the appropriate fragments

This commit is contained in:
antonio 2023-01-04 09:14:15 +01:00
parent 29f56945c2
commit 754fc69eab
54 changed files with 1143 additions and 1137 deletions

View file

@ -19,6 +19,7 @@ import com.cappielloantonio.play.util.DownloadUtil;
import com.cappielloantonio.play.util.MappingUtil;
import com.cappielloantonio.play.util.PreferenceUtil;
import java.util.Collections;
import java.util.List;
public class PlayerBottomSheetViewModel extends AndroidViewModel {
@ -32,6 +33,8 @@ public class PlayerBottomSheetViewModel extends AndroidViewModel {
private final MutableLiveData<Media> liveMedia = new MutableLiveData<>(null);
private final MutableLiveData<Artist> liveArtist = new MutableLiveData<>(null);
private final MutableLiveData<List<Media>> instantMix = new MutableLiveData<>(null);
public PlayerBottomSheetViewModel(@NonNull Application application) {
super(application);
@ -105,4 +108,12 @@ public class PlayerBottomSheetViewModel extends AndroidViewModel {
}
}
}
public LiveData<List<Media>> getMediaInstantMix(LifecycleOwner owner, Media media) {
instantMix.setValue(Collections.emptyList());
songRepository.getInstantMix(media, 20).observe(owner, instantMix::postValue);
return instantMix;
}
}