Posts

Showing posts from August, 2021

CenteringRecyclerView

  public class CenteringRecyclerView extends RecyclerView { public static final int ALIGN_HEAD = 0 ; public static final int ALIGN_TAIL = 1 ; public static final int ALIGN_CENTER = 2 ; public static final int SNAPPING_STRATEGY_HEAD = 0 ; public static final int SNAPPING_STRATEGY_TAIL = 1 ; public static final int SNAPPING_STRATEGY_CENTER = 2 ; public static final int SNAPPING_STRATEGY_NONE = 3 ; private boolean mIgnoreIfVisible ; private boolean mIgnoreIfCompletelyVisible ; public CenteringRecyclerView ( Context context) { this (context, null ); } public CenteringRecyclerView ( Context context, AttributeSet attrs) { this (context, attrs, 0 ); } public CenteringRecyclerView ( Context context, AttributeSet attrs, int defStyle) { super (context, attrs, defStyle); TypedArray a = context.getTheme().obtainStyledAttributes( attrs, R . styleable . CenteringRecyclerView , ...