use of me.zhanghai.android.douya.eventbus.BroadcastUpdatedEvent in project Douya by DreaminginCodeZH.
the class RebroadcastBroadcastWriter method onResponse.
@Override
public void onResponse(Broadcast response) {
ToastUtils.show(mRebroadcast ? R.string.broadcast_rebroadcast_successful : R.string.broadcast_unrebroadcast_successful, getContext());
if (!mRebroadcast) {
// old one.
if (mBroadcast != null && mBroadcast.rebroadcastId != null) {
EventBusUtils.postAsync(new BroadcastDeletedEvent(mBroadcast.rebroadcastId, this));
}
}
EventBusUtils.postAsync(new BroadcastUpdatedEvent(response, this));
stopSelf();
}
use of me.zhanghai.android.douya.eventbus.BroadcastUpdatedEvent in project Douya by DreaminginCodeZH.
the class BroadcastCommentCountFixer method onCommentRemoved.
public static void onCommentRemoved(Broadcast broadcast, Object eventSource) {
if (broadcast == null) {
return;
}
--broadcast.commentCount;
EventBusUtils.postAsync(new BroadcastUpdatedEvent(broadcast, eventSource));
}
use of me.zhanghai.android.douya.eventbus.BroadcastUpdatedEvent in project Douya by DreaminginCodeZH.
the class BroadcastCommentCountFixer method onCommentListChanged.
public static void onCommentListChanged(Broadcast broadcast, List<Comment> commentList, Object eventSource) {
if (broadcast == null || commentList == null) {
return;
}
if (broadcast.commentCount < commentList.size()) {
broadcast.commentCount = commentList.size();
EventBusUtils.postAsync(new BroadcastUpdatedEvent(broadcast, eventSource));
}
}
Aggregations