use of me.zhanghai.android.douya.network.api.info.frodo.RebroadcastItem 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;
}
}
}
use of me.zhanghai.android.douya.network.api.info.frodo.RebroadcastItem in project Douya by DreaminginCodeZH.
the class RebroadcastItemAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
RebroadcastItem rebroadcastItem = getItem(position);
holder.itemView.setOnClickListener(view -> {
if (!rebroadcastItem.hasBroadcast()) {
return;
}
Context context = view.getContext();
context.startActivity(BroadcastActivity.makeIntent(rebroadcastItem.getBroadcastId(), context));
});
ImageUtils.loadAvatar(holder.avatarImage, rebroadcastItem.author.avatar);
holder.avatarImage.setOnClickListener(view -> {
Context context = view.getContext();
context.startActivity(ProfileActivity.makeIntent(rebroadcastItem.author, context));
});
holder.nameText.setText(rebroadcastItem.author.name);
holder.timeText.setDoubanTime(rebroadcastItem.createTime);
holder.textText.setText(rebroadcastItem.getText(holder.textText.getContext()));
}
Aggregations