use of ve.com.abicelis.remindy.app.adapters.AttachmentAdapter in project Remindy by abicelis.
the class TaskDetailActivity method setUpRecyclerView.
private void setUpRecyclerView() {
if (mTask.getAttachments().size() > 0) {
mAttachmentsSubtitle.setVisibility(View.VISIBLE);
mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
mAdapter = new AttachmentAdapter(this, mTask.getAttachments(), true);
mAdapter.setAttachmentDataUpdatedListener(new AttachmentAdapter.AttachmentDataUpdatedListener() {
@Override
public void onAttachmentDataUpdated() {
mTaskDataUpdated = true;
}
});
DividerItemDecoration itemDecoration = new DividerItemDecoration(this, mLayoutManager.getOrientation());
itemDecoration.setDrawable(ContextCompat.getDrawable(this, R.drawable.item_decoration_half_line));
mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter);
}
}
use of ve.com.abicelis.remindy.app.adapters.AttachmentAdapter in project Remindy by abicelis.
the class TaskFragment method setUpRecyclerView.
private void setUpRecyclerView() {
mLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
mAdapter = new AttachmentAdapter(getActivity(), mTask.getAttachments(), false);
mAdapter.setShowAttachmentHintListener(new AttachmentAdapter.ShowAttachmentHintListener() {
@Override
public void onShowAttachmentHint() {
if (!mAttachmentLongClickOptionsDialogHintShown) {
mAttachmentLongClickOptionsDialogHintShown = true;
SnackbarUtil.showSnackbar(mContainer, SnackbarUtil.SnackbarType.NOTICE, R.string.fragment_task_snackbar_notice_attachments_options_hint, SnackbarUtil.SnackbarDuration.LONG, null);
}
}
});
DividerItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), mLayoutManager.getOrientation());
itemDecoration.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.item_decoration_half_line));
mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter);
}
Aggregations