icon change implemented in queque

This commit is contained in:
karol 2020-02-23 23:44:16 +01:00
parent 2a63f2a3a6
commit c4d5886059
3 changed files with 25 additions and 1 deletions

View File

@ -398,6 +398,12 @@ public final class BackgroundPlayer extends Service {
updatePlayback();
}
@Override
public void onMuteUnmuteButtonClicled() {
super.onMuteUnmuteButtonClicled();
updatePlayback();
}
@Override
public void onUpdateProgress(int currentProgress, int duration, int bufferPercent) {
updateProgress(currentProgress, duration, bufferPercent);

View File

@ -607,6 +607,12 @@ public final class PopupVideoPlayer extends Service {
updatePlayback();
}
@Override
public void onMuteUnmuteButtonClicled() {
super.onMuteUnmuteButtonClicled();
updatePlayback();
}
@Override
public void onUpdateProgress(int currentProgress, int duration, int bufferPercent) {
updateProgress(currentProgress, duration, bufferPercent);

View File

@ -7,6 +7,7 @@ import android.os.Bundle;
import android.os.IBinder;
import android.provider.Settings;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
@ -22,6 +23,7 @@ import android.widget.PopupMenu;
import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player;
@ -560,6 +562,7 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
onPlayModeChanged(repeatMode, shuffled);
onPlaybackParameterChanged(parameters);
onMaybePlaybackAdapterChanged();
onMaybeMuteChanged();
}
@Override
@ -667,7 +670,7 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
final int shuffleAlpha = shuffled ? 255 : 77;
shuffleButton.setImageAlpha(shuffleAlpha);
}
private void onPlaybackParameterChanged(final PlaybackParameters parameters) {
if (parameters != null) {
playbackSpeedButton.setText(formatSpeed(parameters.speed));
@ -682,4 +685,13 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
itemsList.setAdapter(maybeNewAdapter);
}
}
private void onMaybeMuteChanged(){
if (player.isMuted()) {
muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.white));
}
else {
muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.gray));
}
}
}