1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 11:02:35 +01:00

Make PlayerHolder.bound private

This commit is contained in:
TobiGr 2021-12-21 00:18:58 +01:00
parent 96eb1425f8
commit a163d5461d
2 changed files with 7 additions and 3 deletions

View File

@ -685,7 +685,7 @@ public final class VideoDetailFragment
}); });
setupBottomPlayer(); setupBottomPlayer();
if (!playerHolder.bound) { if (!playerHolder.isBound()) {
setHeightThumbnail(); setHeightThumbnail();
} else { } else {
playerHolder.startService(false, this); playerHolder.startService(false, this);
@ -1434,7 +1434,7 @@ public final class VideoDetailFragment
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
} }
// Rebound to the service if it was closed via notification or mini player // Rebound to the service if it was closed via notification or mini player
if (!playerHolder.bound) { if (!playerHolder.isBound()) {
playerHolder.startService( playerHolder.startService(
false, VideoDetailFragment.this); false, VideoDetailFragment.this);
} }

View File

@ -41,7 +41,7 @@ public final class PlayerHolder {
private PlayerServiceExtendedEventListener listener; private PlayerServiceExtendedEventListener listener;
private final PlayerServiceConnection serviceConnection = new PlayerServiceConnection(); private final PlayerServiceConnection serviceConnection = new PlayerServiceConnection();
public boolean bound; private boolean bound;
private MainPlayer playerService; private MainPlayer playerService;
private Player player; private Player player;
@ -70,6 +70,10 @@ public final class PlayerHolder {
return player != null; return player != null;
} }
public boolean isBound() {
return bound;
}
public int getQueueSize() { public int getQueueSize() {
return isPlayerOpen() ? player.getPlayQueue().size() : 0; return isPlayerOpen() ? player.getPlayQueue().size() : 0;
} }