From 92ee51b8db64b4ba6d4dfb22a925af2b4a37dd02 Mon Sep 17 00:00:00 2001 From: karol Date: Mon, 2 Mar 2020 21:12:02 +0100 Subject: [PATCH] resolved issues --- .../java/org/schabi/newpipe/player/BackgroundPlayer.java | 1 + .../main/java/org/schabi/newpipe/player/BasePlayer.java | 2 +- .../java/org/schabi/newpipe/player/MainVideoPlayer.java | 7 +------ .../org/schabi/newpipe/player/ServicePlayerActivity.java | 7 +------ 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java index dbf27ea7c..4eaa2a73b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java @@ -341,6 +341,7 @@ public final class BackgroundPlayer extends Service { @Override public void handleIntent(final Intent intent) { super.handleIntent(intent); + resetNotification(); if (bigNotRemoteView != null) bigNotRemoteView.setProgressBar(R.id.notificationProgressBar, 100, 0, false); diff --git a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java index adffefa6e..a71671e7b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java @@ -332,7 +332,7 @@ public abstract class BasePlayer implements if (playQueueAdapter != null) playQueueAdapter.dispose(); playQueueAdapter = new PlayQueueAdapter(context, playQueue); - if (isMuted) simpleExoPlayer.setVolume(0); + simpleExoPlayer.setVolume(isMuted ? 0 : 1); } public void destroyPlayer() { diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index 63d95e74f..d74a739cf 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -401,12 +401,7 @@ public final class MainVideoPlayer extends AppCompatActivity } protected void setMuteButton(final ImageButton muteButton, final boolean isMuted) { - if (isMuted) { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } else { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.gray)); - - } + muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), isMuted ? R.color.white : R.color.gray)); } diff --git a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java index c0a8d2bfd..10b202e4c 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java @@ -687,11 +687,6 @@ public abstract class ServicePlayerActivity extends AppCompatActivity } private void onMaybeMuteChanged(){ - if (player.isMuted()) { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } - else { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.gray)); - } + muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), player.isMuted() ? R.color.white : R.color.gray)); } }