use of ve.com.abicelis.remindy.app.adapters.ListItemAttachmentAdapter 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);
}
Aggregations