From f469350497184c9558e338d9dad25c953b6cbba3 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 5 Jun 2016 12:28:11 +0200 Subject: Prevent possible hang-bugs --- .../java/de/danoeh/antennapod/fragment/ItemFragment.java | 4 +++- .../danoeh/antennapod/adapter/ActionButtonCallback.java | 3 ++- .../antennapod/adapter/AllEpisodesRecycleAdapter.java | 4 +++- .../antennapod/adapter/DefaultActionButtonCallback.java | 3 +-- .../de/danoeh/antennapod/adapter/FeedItemlistAdapter.java | 5 ++++- .../danoeh/antennapod/adapter/QueueRecyclerAdapter.java | 2 +- .../danoeh/antennapod/fragment/AllEpisodesFragment.java | 14 ++++++++++++++ .../de/danoeh/antennapod/fragment/ItemlistFragment.java | 15 +++++++++++++++ .../antennapod/fragment/PlaybackHistoryFragment.java | 15 +++++++++++++++ .../java/de/danoeh/antennapod/activity/MainActivity.java | 2 +- .../java/de/danoeh/antennapod/fragment/ItemFragment.java | 4 +++- 11 files changed, 62 insertions(+), 9 deletions(-) (limited to 'app/src') diff --git a/app/src/free/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/free/java/de/danoeh/antennapod/fragment/ItemFragment.java index 2b2808adc..0e11a5a17 100644 --- a/app/src/free/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/free/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -58,6 +58,7 @@ import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.DateUtils; import de.danoeh.antennapod.core.util.IntentUtils; +import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.ShareUtils; import de.danoeh.antennapod.core.util.playback.Timeline; import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; @@ -219,7 +220,8 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { return; } DefaultActionButtonCallback actionButtonCallback = new DefaultActionButtonCallback(getActivity()); - actionButtonCallback.onActionButtonPressed(item); + actionButtonCallback.onActionButtonPressed(item, item.isTagged(FeedItem.TAG_QUEUE) ? + LongList.of(item.getId()) : new LongList(0)); FeedMedia media = item.getMedia(); if (media != null && media.isDownloaded()) { // playback was started, dialog should close itself diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ActionButtonCallback.java b/app/src/main/java/de/danoeh/antennapod/adapter/ActionButtonCallback.java index 66e6f9a00..c18564351 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ActionButtonCallback.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ActionButtonCallback.java @@ -1,8 +1,9 @@ package de.danoeh.antennapod.adapter; import de.danoeh.antennapod.core.feed.FeedItem; +import de.danoeh.antennapod.core.util.LongList; public interface ActionButtonCallback { /** Is called when the action button of a list item has been pressed. */ - void onActionButtonPressed(FeedItem item); + void onActionButtonPressed(FeedItem item, LongList queueIds); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index d961b548f..3e8bbc488 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -232,7 +232,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter