Java Code Examples for android.support.v7.widget.RecyclerView#ItemDecoration

The following examples show how to use android.support.v7.widget.RecyclerView#ItemDecoration . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CardViewActivity.java    From SwipeRecyclerView-master with Apache License 2.0 5 votes vote down vote up
@Override
protected RecyclerView.ItemDecoration createItemDecoration() {
    return new RecyclerView.ItemDecoration() {
        @Override
        public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
            outRect.set(20, 20, 20, 20);
        }
    };
}
 
Example 2
Source File: TvDevicesActivity.java    From TvRemoteControl with Apache License 2.0 5 votes vote down vote up
private void initDevices() {
    if (rvDevices != null) {
        rvDevices.setAdapter(getDevices());
        rvDevices.setLayoutManager(new LinearLayoutManager(this));
        rvDevices.setHasFixedSize(true);
        rvDevices.setOverScrollMode(View.OVER_SCROLL_NEVER);
        RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST);
        rvDevices.addItemDecoration(itemDecoration);
    }
}
 
Example 3
Source File: PictureListFragment.java    From DoingDaily with Apache License 2.0 4 votes vote down vote up
@Override
protected RecyclerView.ItemDecoration getItemDecoration() {
    int vertical = getResources().getDimensionPixelOffset(R.dimen.staggered_vertical_spacing);
    int horizontal = getResources().getDimensionPixelOffset(R.dimen.staggered_horizontal_spacing);
    return new StaggeredDividerItemDecoration(vertical, horizontal);
}
 
Example 4
Source File: PracticalRecyclerView.java    From PracticalRecyclerView with Apache License 2.0 4 votes vote down vote up
public void removeItemDecoration(RecyclerView.ItemDecoration decor) {
    mRecyclerView.removeItemDecoration(decor);
}
 
Example 5
Source File: AbstractListActivity.java    From eternity with Apache License 2.0 4 votes vote down vote up
protected RecyclerView.ItemDecoration getItemDividerDecoration() {
  return new DividerItemDecoration(this, DividerItemDecoration.VERTICAL);
}
 
Example 6
Source File: ScrollRefreshRecyclerView.java    From NovelReader with MIT License 4 votes vote down vote up
public void addItemDecoration(RecyclerView.ItemDecoration decoration){
    mRecyclerView.addItemDecoration(decoration);
}
 
Example 7
Source File: HorizontalFragment.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
protected RecyclerView.ItemDecoration getItemDecoration() {
    return new InsetDecoration(getActivity());
}
 
Example 8
Source File: HTRefreshRecyclerView.java    From ht-refreshrecyclerview with MIT License 4 votes vote down vote up
@Override
public void addItemDecoration(RecyclerView.ItemDecoration decor, int index) {
    mRecyclerViewProxy.addItemDecoration(decor, index);
}
 
Example 9
Source File: RecyclerWidget.java    From relight with Apache License 2.0 4 votes vote down vote up
public RecyclerWidget<V> removeItemDecoration(@NonNull RecyclerView.ItemDecoration decor) {
    view.removeItemDecoration(decor);
    return self();
}
 
Example 10
Source File: EasyRecyclerView.java    From BookReader with Apache License 2.0 4 votes vote down vote up
public void removeItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
    mRecycler.removeItemDecoration(itemDecoration);
}
 
Example 11
Source File: StaticTwoWayFragment.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
protected RecyclerView.ItemDecoration getItemDecoration() {
    return new InsetDecoration(getActivity());
}
 
Example 12
Source File: DetectedImagesFragment.java    From ml with Apache License 2.0 4 votes vote down vote up
@Override
protected RecyclerView.ItemDecoration onCreateItemDecoration() {
    return null;
}
 
Example 13
Source File: HTBaseRecyclerView.java    From ht-refreshrecyclerview with MIT License 4 votes vote down vote up
@Override
public void removeItemDecoration(RecyclerView.ItemDecoration decor) {
    mRecyclerView.removeItemDecoration(decor);
}
 
Example 14
Source File: PracticalRecyclerView.java    From FastDownloader with Apache License 2.0 4 votes vote down vote up
public void addItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
    mRecyclerView.addItemDecoration(itemDecoration);
}
 
Example 15
Source File: BaseListActivity.java    From PullRecycler with MIT License 4 votes vote down vote up
protected RecyclerView.ItemDecoration getItemDecoration() {
    return new DividerItemDecoration(getApplicationContext(), R.drawable.list_divider);
}
 
Example 16
Source File: HarvestRecyclerView.java    From RefreshLoadMoreRecyclerView with MIT License 2 votes vote down vote up
/**
 * optional setting
 *
 * @param itemDecoration
 */
public void addItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
    if (itemDecoration != null)
        recyclerView.addItemDecoration(itemDecoration);
}
 
Example 17
Source File: LucklyPopopWindow.java    From luckly_popup_window with MIT License 2 votes vote down vote up
/**
 * 添加分割线
 *
 * @param itemDecoration
 */
public void addItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
    mRecyclerView.addItemDecoration(itemDecoration);
}
 
Example 18
Source File: YCRefreshView.java    From YCRefreshView with Apache License 2.0 2 votes vote down vote up
/**
 * 添加分割线
 * @param itemDecoration        分割线
 */
public void addItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
    mRecyclerView.addItemDecoration(itemDecoration);
}
 
Example 19
Source File: YCRefreshView.java    From YCRefreshView with Apache License 2.0 2 votes vote down vote up
/**
 * 移除分割线
 * @param itemDecoration        分割线
 */
public void removeItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
    mRecyclerView.removeItemDecoration(itemDecoration);
}
 
Example 20
Source File: RecyclerFragment.java    From UltimateAndroid with Apache License 2.0 votes vote down vote up
protected abstract RecyclerView.ItemDecoration getItemDecoration();