Skip to content

Instantly share code, notes, and snippets.

View Sevastyan's full-sized avatar

Sevastyan Savanyuk Sevastyan

View GitHub Profile
@Sevastyan
Sevastyan / ItemDecoration.java
Created January 30, 2018 10:07 — forked from mandybess/ItemDecoration.java
RecyclerView extension that "sticks" items in the center on scroll
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class ItemDecoration extends RecyclerView.ItemDecoration {
/**
*
* {@link #startPadding} and {@link #endPadding} are final and required on initialization
* because {@link android.support.v7.widget.RecyclerView.ItemDecoration} are drawn