use of ve.com.abicelis.remindy.app.holders.AudioAttachmentViewHolder in project Remindy by abicelis.
the class AttachmentAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
Attachment current = mAttachments.get(position);
switch(current.getType()) {
case TEXT:
TextAttachmentViewHolder tvh = (TextAttachmentViewHolder) holder;
tvh.setData(this, mActivity, (TextAttachment) current, position, mRealTimeDataPersistence);
tvh.setListeners();
break;
case LIST:
ListAttachmentViewHolder listvh = (ListAttachmentViewHolder) holder;
listvh.setData(this, mActivity, (ListAttachment) current, position, mRealTimeDataPersistence);
listvh.setListeners();
break;
case LINK:
LinkAttachmentViewHolder lvh = (LinkAttachmentViewHolder) holder;
lvh.setData(this, mActivity, (LinkAttachment) current, position, mRealTimeDataPersistence);
lvh.setListeners();
break;
case AUDIO:
AudioAttachmentViewHolder avh = (AudioAttachmentViewHolder) holder;
avh.setData(this, mActivity, (AudioAttachment) current, position, mRealTimeDataPersistence);
//avh.setListeners();
break;
case IMAGE:
ImageAttachmentViewHolder ivh = (ImageAttachmentViewHolder) holder;
ivh.setData(this, mActivity, (ImageAttachment) current, position, mRealTimeDataPersistence);
ivh.setListeners();
break;
default:
throw new InvalidParameterException("Wrong viewType passed to onCreateViewHolder in AttachmentAdapter");
}
}
Aggregations