use of org.greenrobot.eventbus.Subscribe 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 org.greenrobot.eventbus.Subscribe in project Douya by DreaminginCodeZH.
the class TimelineBroadcastListResource method onBroadcastUpdated.
@Subscribe(threadMode = ThreadMode.POSTING)
public void onBroadcastUpdated(BroadcastUpdatedEvent event) {
if (event.isFromMyself(this) || isEmpty()) {
return;
}
List<Broadcast> broadcastList = get();
for (int i = 0, size = broadcastList.size(); i < size; ++i) {
Broadcast updatedBroadcast = event.update(broadcastList.get(i), this);
if (updatedBroadcast != null) {
broadcastList.set(i, updatedBroadcast);
getListener().onBroadcastChanged(getRequestCode(), i, updatedBroadcast);
}
}
}
use of org.greenrobot.eventbus.Subscribe in project Douya by DreaminginCodeZH.
the class BroadcastActivityDialogFragment method onBroadcastUpdated.
@Subscribe(threadMode = ThreadMode.POSTING)
public void onBroadcastUpdated(BroadcastUpdatedEvent event) {
if (event.isFromMyself(this)) {
return;
}
Broadcast updatedBroadcast = event.update(mBroadcast, this);
if (updatedBroadcast != null) {
mBroadcast = updatedBroadcast;
updateTabTitle();
}
}
use of org.greenrobot.eventbus.Subscribe in project Douya by DreaminginCodeZH.
the class BroadcastResource method onBroadcastUpdated.
@Subscribe(threadMode = ThreadMode.POSTING)
public void onBroadcastUpdated(BroadcastUpdatedEvent event) {
if (event.isFromMyself(this)) {
return;
}
// noinspection deprecation
Broadcast updatedBroadcast = event.update(mBroadcastId, get(), this);
if (updatedBroadcast != null) {
set(updatedBroadcast);
getListener().onBroadcastChanged(getRequestCode(), updatedBroadcast);
}
}
use of org.greenrobot.eventbus.Subscribe in project Douya by DreaminginCodeZH.
the class BroadcastRebroadcastListResource method onBroadcastDeleted.
@Subscribe(threadMode = ThreadMode.POSTING)
public void onBroadcastDeleted(BroadcastDeletedEvent event) {
if (event.isFromMyself(this) || isEmpty()) {
return;
}
List<RebroadcastItem> rebroadcastList = get();
for (int i = 0, size = rebroadcastList.size(); i < size; ) {
RebroadcastItem rebroadcastItem = rebroadcastList.get(i);
if (rebroadcastItem.getBroadcastId() == event.broadcastId) {
rebroadcastList.remove(i);
getListener().onRebroadcastItemRemoved(getRequestCode(), i);
--size;
}
}
}
Aggregations