Currently playing item cannot be removed from the queue any longer
This commit is contained in:
parent
2bcb1df73a
commit
80206b19a8
|
@ -4,6 +4,7 @@ import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
@ -890,7 +891,17 @@ public class FeedManager {
|
||||||
public void clearQueue(final Context context) {
|
public void clearQueue(final Context context) {
|
||||||
if (AppConfig.DEBUG)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG, "Clearing queue");
|
Log.d(TAG, "Clearing queue");
|
||||||
queue.clear();
|
Iterator<FeedItem> iter = queue.iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
FeedItem item = iter.next();
|
||||||
|
if (item.getState() != FeedItem.State.PLAYING) {
|
||||||
|
iter.remove();
|
||||||
|
} else {
|
||||||
|
if (AppConfig.DEBUG)
|
||||||
|
Log.d(TAG,
|
||||||
|
"FeedItem is playing and is therefore not removed from the queue");
|
||||||
|
}
|
||||||
|
}
|
||||||
eventDist.sendQueueUpdateBroadcast();
|
eventDist.sendQueueUpdateBroadcast();
|
||||||
dbExec.execute(new Runnable() {
|
dbExec.execute(new Runnable() {
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class FeedItemMenuHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isInQueue = manager.isInQueue(selectedItem);
|
boolean isInQueue = manager.isInQueue(selectedItem);
|
||||||
if (!isInQueue) {
|
if (!isInQueue || isPlaying) {
|
||||||
mi.setItemVisibility(R.id.remove_from_queue_item, false);
|
mi.setItemVisibility(R.id.remove_from_queue_item, false);
|
||||||
}
|
}
|
||||||
if (!(!isInQueue && selectedItem.getMedia() != null)) {
|
if (!(!isInQueue && selectedItem.getMedia() != null)) {
|
||||||
|
|
Loading…
Reference in New Issue