Search in sources :

Example 1 with ListItemAttachment

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);
}
Also used : ListItemAttachmentAdapter(ve.com.abicelis.remindy.app.adapters.ListItemAttachmentAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) ListItemAttachment(ve.com.abicelis.remindy.model.attachment.ListItemAttachment)

Example 2 with ListItemAttachment

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();
}
Also used : ListItemAttachment(ve.com.abicelis.remindy.model.attachment.ListItemAttachment)

Example 3 with ListItemAttachment

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);
}
Also used : ListItemAttachment(ve.com.abicelis.remindy.model.attachment.ListItemAttachment)

Aggregations

ListItemAttachment (ve.com.abicelis.remindy.model.attachment.ListItemAttachment)3 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 ListItemAttachmentAdapter (ve.com.abicelis.remindy.app.adapters.ListItemAttachmentAdapter)1