use of ve.com.abicelis.remindy.model.attachment.ListItemAttachment in project Remindy by abicelis.
the class ListAttachmentViewHolder method setUpRecyclerView.
private void setUpRecyclerView() {
List<ListItemAttachment> items = mCurrent.getItems();
if (//If no items or last item of list isn't blank, add a blank item
items.size() == 0 || items.get(items.size() - 1).getText() != null)
items.add(new ListItemAttachment());
mLayoutManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
mListItemAdapter = new ListItemAttachmentAdapter(mActivity, items, mRealTimeDataPersistence);
mListItemAdapter.setAttachmentDataUpdatedListener(new ListItemAttachmentAdapter.AttachmentDataUpdatedListener() {
@Override
public void onAttachmentDataUpdated() {
mAttachmentAdapter.triggerAttachmentDataUpdatedListener();
}
});
DividerItemDecoration itemDecoration = new DividerItemDecoration(mActivity, mLayoutManager.getOrientation());
itemDecoration.setDrawable(ContextCompat.getDrawable(mActivity, R.drawable.item_decoration_complete_line));
mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mListItemAdapter);
}
use of ve.com.abicelis.remindy.model.attachment.ListItemAttachment in project Remindy by abicelis.
the class ListItemAttachmentAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(ListItemAttachmentViewHolder holder, int position) {
ListItemAttachment current = mListItems.get(position);
holder.setData(this, mActivity, current, position, mRealTimeDataPersistence);
holder.setListeners();
}
use of ve.com.abicelis.remindy.model.attachment.ListItemAttachment in project Remindy by abicelis.
the class ListItemAttachmentAdapter method insertNewBlankItem.
public void insertNewBlankItem() {
mListItems.add(new ListItemAttachment());
notifyItemInserted(getItemCount() - 1);
}
Aggregations