Only prevent deletion if PlaybackService is running (Closes #2759)

This commit is contained in:
ByteHamster 2018-07-13 09:18:12 +02:00
parent 3375fe0a24
commit cc645c5fb1
2 changed files with 3 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import com.bumptech.glide.Glide;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.glide.ApGlideSettings;
import de.danoeh.antennapod.core.service.playback.PlaybackService;
import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.DateUtils;
@ -98,7 +99,7 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
holder.pubDate.setText(pubDateStr);
FeedItem.State state = item.getState();
if (state == FeedItem.State.PLAYING) {
if (state == FeedItem.State.PLAYING && PlaybackService.isRunning) {
holder.butSecondary.setEnabled(false);
holder.butSecondary.setAlpha(0.5f);
} else {

View File

@ -436,7 +436,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
}
FeedItem.State state = item.getState();
if (butAction2Text == R.string.delete_label && state == FeedItem.State.PLAYING) {
if (butAction2Text == R.string.delete_label && state == FeedItem.State.PLAYING && PlaybackService.isRunning) {
butAction2.setEnabled(false);
butAction2.setAlpha(0.5f);
} else {