diff options
author | ByteHamster <info@bytehamster.com> | 2022-09-30 17:46:13 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-10-04 19:48:47 +0200 |
commit | b0b95f0a05c216e8af62b21433658e2cc0c55441 (patch) | |
tree | 54068739d18f0f01a3b93eae030d517b75e9ceb9 /app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java | |
parent | b605901c52bffd7b274a0718840acd189b3717e4 (diff) | |
download | AntennaPod-b0b95f0a05c216e8af62b21433658e2cc0c55441.zip |
Reorder queue section when pressing play, not when pausing
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java index efff7927e..57fc85192 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java @@ -113,14 +113,24 @@ public class QueueSection extends HomeSection { if (listAdapter == null) { return; } + boolean foundCurrentlyPlayingItem = false; + boolean currentlyPlayingItemIsFirst = true; for (int i = 0; i < listAdapter.getItemCount(); i++) { HorizontalItemViewHolder holder = (HorizontalItemViewHolder) viewBinding.recyclerView.findViewHolderForAdapterPosition(i); - if (holder != null && holder.isCurrentlyPlayingItem()) { + if (holder == null) { + continue; + } + if (holder.isCurrentlyPlayingItem()) { holder.notifyPlaybackPositionUpdated(event); + foundCurrentlyPlayingItem = true; + currentlyPlayingItemIsFirst = (i == 0); break; } } + if (!foundCurrentlyPlayingItem || !currentlyPlayingItemIsFirst) { + loadItems(); + } } @Override |