Skip to content

Instantly share code, notes, and snippets.

Avatar

Hans Petter Eide hanspeide

View GitHub Profile
@mandybess
mandybess / ItemDecoration.java
Last active Aug 4, 2020
RecyclerView extension that "sticks" items in the center on scroll
View ItemDecoration.java
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