use of android.support.v7.widget.DividerItemDecoration in project Remindy by abicelis.
the class HomeListFragment method setUpRecyclerView.
private void setUpRecyclerView() {
mLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
mAdapter = new HomeAdapter(this, mTasks);
//DividerItemDecoration itemDecoration = new DividerItemDecoration(getContext(), mLayoutManager.getOrientation());
//itemDecoration.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.item_decoration_half_line));
//mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter);
}
use of android.support.v7.widget.DividerItemDecoration 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 android.support.v7.widget.DividerItemDecoration 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 android.support.v7.widget.DividerItemDecoration in project Remindy by abicelis.
the class PlaceListActivity method setUpRecyclerView.
private void setUpRecyclerView() {
mLayoutManager = new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.VERTICAL, false);
mAdapter = new PlaceAdapter(this, mPlaces);
DividerItemDecoration itemDecoration = new DividerItemDecoration(this, mLayoutManager.getOrientation());
itemDecoration.setDrawable(ContextCompat.getDrawable(this, R.drawable.item_decoration_complete_line));
mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter);
}
use of android.support.v7.widget.DividerItemDecoration in project YourAppIdea by Michenux.
the class CityListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.city_fragment, container, false);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.city_listview);
recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
linearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
recyclerView.setAdapter(this.mAdapter);
ItemClickSupport.addTo(recyclerView).setOnItemClickListener(this);
return view;
}
Aggregations