From 883bcc735d34f70ecb496b9d86731daf473dd9c5 Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 1 Apr 2020 22:33:37 +0200 Subject: [PATCH] Fix pause used instead of play in paused popup player when seeking Also use `setBackgroundResource` to automatically obtain PNG drawables (from exoplayer) --- .../org/schabi/newpipe/player/PopupVideoPlayer.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 87b8f282e..c2d7c389e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -905,8 +905,7 @@ public final class PopupVideoPlayer extends Service { resetNotification(); updateNotification(R.drawable.exo_controls_pause); - videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(), - R.drawable.ic_pause_white_24dp)); + videoPlayPause.setBackgroundResource(R.drawable.exo_controls_pause); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); startForeground(NOTIFICATION_ID, notBuilder.build()); @@ -927,8 +926,7 @@ public final class PopupVideoPlayer extends Service { resetNotification(); updateNotification(R.drawable.exo_controls_play); - videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(), - R.drawable.ic_play_arrow_white_24dp)); + videoPlayPause.setBackgroundResource(R.drawable.exo_controls_play); stopForeground(false); } @@ -939,8 +937,7 @@ public final class PopupVideoPlayer extends Service { resetNotification(); updateNotification(R.drawable.exo_controls_play); - videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(), - R.drawable.ic_pause_white_24dp)); + videoPlayPause.setBackgroundResource(R.drawable.exo_controls_play); } @Override @@ -951,8 +948,7 @@ public final class PopupVideoPlayer extends Service { resetNotification(); updateNotification(R.drawable.ic_replay_white_24dp); - videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(), - R.drawable.ic_replay_white_24dp)); + videoPlayPause.setBackgroundResource(R.drawable.ic_replay_white_24dp); stopForeground(false); }