mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 14:15:14 +00:00
mprisplugin: allow hiding per-app volume meter if not supported by remote media app
This commit is contained in:
@@ -338,7 +338,9 @@ public class MprisNowPlayingFragment extends Fragment implements VolumeKeyListen
|
|||||||
|
|
||||||
int volume = playerStatus.getVolume();
|
int volume = playerStatus.getVolume();
|
||||||
mprisControlBinding.volumeSeek.setProgress(volume);
|
mprisControlBinding.volumeSeek.setProgress(volume);
|
||||||
|
if(!playerStatus.isSetVolumeAllowed()) {
|
||||||
|
mprisControlBinding.volumeSeek.setEnabled(false);
|
||||||
|
}
|
||||||
boolean isPlaying = playerStatus.isPlaying();
|
boolean isPlaying = playerStatus.isPlaying();
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
mprisControlBinding.playButton.setImageResource(R.drawable.ic_pause_black);
|
mprisControlBinding.playButton.setImageResource(R.drawable.ic_pause_black);
|
||||||
|
@@ -150,7 +150,7 @@ public class MprisPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSetVolumeAllowed() {
|
public boolean isSetVolumeAllowed() {
|
||||||
return !isSpotify();
|
return !isSpotify() && (getVolume() > -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getPosition() {
|
public long getPosition() {
|
||||||
|
Reference in New Issue
Block a user