use of de.danoeh.antennapod.core.event.DownloaderUpdate in project AntennaPod by AntennaPod.
the class QueueFragment method onEventMainThread.
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(DownloadEvent event) {
Log.d(TAG, "onEventMainThread() called with DownloadEvent");
DownloaderUpdate update = event.update;
if (event.hasChangedFeedUpdateStatus(isUpdatingFeeds)) {
refreshToolbarState();
}
if (recyclerAdapter != null && update.mediaIds.length > 0) {
for (long mediaId : update.mediaIds) {
int pos = FeedItemUtil.indexOfItemWithMediaId(queue, mediaId);
if (pos >= 0) {
recyclerAdapter.notifyItemChangedCompat(pos);
}
}
}
}
use of de.danoeh.antennapod.core.event.DownloaderUpdate in project AntennaPod by AntennaPod.
the class EpisodesListFragment method onEventMainThread.
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(DownloadEvent event) {
Log.d(TAG, "onEventMainThread() called with: " + "event = [" + event + "]");
DownloaderUpdate update = event.update;
if (event.hasChangedFeedUpdateStatus(isUpdatingFeeds)) {
((PagedToolbarFragment) getParentFragment()).invalidateOptionsMenuIfActive(this);
}
if (update.mediaIds.length > 0) {
for (long mediaId : update.mediaIds) {
int pos = FeedItemUtil.indexOfItemWithMediaId(episodes, mediaId);
if (pos >= 0) {
listAdapter.notifyItemChangedCompat(pos);
}
}
}
}
use of de.danoeh.antennapod.core.event.DownloaderUpdate in project AntennaPod by AntennaPod.
the class FeedItemlistFragment method onEventMainThread.
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(DownloadEvent event) {
Log.d(TAG, "onEventMainThread() called with: " + "event = [" + event + "]");
DownloaderUpdate update = event.update;
if (event.hasChangedFeedUpdateStatus(isUpdatingFeed)) {
updateSyncProgressBarVisibility();
}
if (adapter != null && update.mediaIds.length > 0 && feed != null) {
for (long mediaId : update.mediaIds) {
int pos = FeedItemUtil.indexOfItemWithMediaId(feed.getItems(), mediaId);
if (pos >= 0) {
adapter.notifyItemChangedCompat(pos);
}
}
}
}
use of de.danoeh.antennapod.core.event.DownloaderUpdate in project AntennaPod by AntennaPod.
the class PlaybackHistoryFragment method onEvent.
public void onEvent(DownloadEvent event) {
Log.d(TAG, "onEvent() called with: " + "event = [" + event + "]");
DownloaderUpdate update = event.update;
downloaderList = update.downloaders;
if (adapter != null) {
adapter.notifyDataSetChanged();
}
}
use of de.danoeh.antennapod.core.event.DownloaderUpdate in project AntennaPod by AntennaPod.
the class RunningDownloadsFragment method onEvent.
public void onEvent(DownloadEvent event) {
Log.d(TAG, "onEvent() called with: " + "event = [" + event + "]");
DownloaderUpdate update = event.update;
downloaderList = update.downloaders;
if (adapter != null) {
adapter.notifyDataSetChanged();
}
}
Aggregations