Search in sources :

Example 31 with DividerItemDecoration

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

Example 32 with DividerItemDecoration

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

Example 33 with DividerItemDecoration

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);
}
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 34 with DividerItemDecoration

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

Example 35 with DividerItemDecoration

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;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)73 RecyclerView (android.support.v7.widget.RecyclerView)42 View (android.view.View)36 TextView (android.widget.TextView)23 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)19 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)15 ImageView (android.widget.ImageView)14 DividerItemDecoration (com.wm.remusic.widget.DividerItemDecoration)9 Drawable (android.graphics.drawable.Drawable)8 DividerItemDecoration (de.madcyph3r.example.DividerItemDecoration)8 DividerItemDecoration (io.hefuyi.listener.widget.DividerItemDecoration)7 Nullable (android.support.annotation.Nullable)6 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)6 Context (android.content.Context)5 Toolbar (android.support.v7.widget.Toolbar)5 Intent (android.content.Intent)4 ActionBar (android.support.v7.app.ActionBar)4 DividerItemDecoration (com.lzy.demo.base.DividerItemDecoration)4 DividerItemDecoration (org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration)4 TargetApi (android.annotation.TargetApi)3