public static int getCenterYChildPosition ( RecyclerView recyclerView ) { int childCount = recyclerView . getChildCount ( ) ; for ( int i = 0 ; i < childCount ; i ++ ) { View child = recyclerView . getChildAt ( i ) ; if ( isChildInCenterY ( recyclerView , child ) ) { return recyclerView . getChildAdapterPosition ( child ) ; } } return childCount ; }
Get position of center child in Y Axes