public static View getCenterItem(RecyclerView recyclerView, boolean horisontal) { if (horisontal) { return ViewUtils.getCenterXChild(recyclerView); } else { return ViewUtils.getCenterYChild(recyclerView); } }
public static int getCenterItemPosition(RecyclerView recyclerView, boolean horisontal) { int curPosition = -1; if (horisontal) { curPosition = ViewUtils.getCenterXChildPosition(recyclerView); } else { curPosition = ViewUtils.getCenterYChildPosition(recyclerView); } return curPosition; }