From a163d5461d20f722cc21a9b47180bb74b10a012e Mon Sep 17 00:00:00 2001 From: TobiGr Date: Tue, 21 Dec 2021 00:18:58 +0100 Subject: [PATCH] Make PlayerHolder.bound private --- .../newpipe/fragments/detail/VideoDetailFragment.java | 4 ++-- .../java/org/schabi/newpipe/player/helper/PlayerHolder.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 6a956c6dc..a5e590ba0 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -685,7 +685,7 @@ public final class VideoDetailFragment }); setupBottomPlayer(); - if (!playerHolder.bound) { + if (!playerHolder.isBound()) { setHeightThumbnail(); } else { playerHolder.startService(false, this); @@ -1434,7 +1434,7 @@ public final class VideoDetailFragment bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); } // Rebound to the service if it was closed via notification or mini player - if (!playerHolder.bound) { + if (!playerHolder.isBound()) { playerHolder.startService( false, VideoDetailFragment.this); } diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHolder.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHolder.java index 46239cab1..3d960ae90 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHolder.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHolder.java @@ -41,7 +41,7 @@ public final class PlayerHolder { private PlayerServiceExtendedEventListener listener; private final PlayerServiceConnection serviceConnection = new PlayerServiceConnection(); - public boolean bound; + private boolean bound; private MainPlayer playerService; private Player player; @@ -70,6 +70,10 @@ public final class PlayerHolder { return player != null; } + public boolean isBound() { + return bound; + } + public int getQueueSize() { return isPlayerOpen() ? player.getPlayQueue().size() : 0; }