void getCurScrollState() {
        scrollPosState.rowIndex = -1;
        scrollPosState.rowTopOffset = -1;
        scrollPosState.rowHeight = -1;

        if  (materialScrollBar.recyclerView.getAdapter() == null) {
            Log.e("MaterialScrollBarLib", "The adapter for your recyclerView has not been set; " +
                    "skipping layout.");
            return;
        }

        int itemCount = materialScrollBar.recyclerView.getAdapter().getItemCount();

        // Return early if there are no items
        if(itemCount == 0) {
            return;
        }

        View child = materialScrollBar.recyclerView.getChildAt(0);

        scrollPosState.rowIndex = materialScrollBar.recyclerView.getChildAdapterPosition(child);
        scrollPosState.indicatorPosition = getIndicatorPosition();

        if(materialScrollBar.recyclerView.getLayoutManager() instanceof GridLayoutManager) {
            scrollPosState.rowIndex = scrollPosState.rowIndex / ((GridLayoutManager) materialScrollBar.recyclerView.getLayoutManager()).getSpanCount();
        }
        if(child == null) {
            scrollPosState.rowTopOffset = 0;
            scrollPosState.rowHeight = 0;
        } else {
            scrollPosState.rowTopOffset = materialScrollBar.recyclerView.getLayoutManager().getDecoratedTop(child);
            scrollPosState.rowHeight = child.getHeight();
            if (child.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
                scrollPosState.rowHeight += ((ViewGroup.MarginLayoutParams)child.getLayoutParams()).topMargin;
                scrollPosState.rowHeight += ((ViewGroup.MarginLayoutParams)child.getLayoutParams()).bottomMargin;
            }
        }
    }
Scrolls to the specified fraction of the RV

@param touchFraction the fraction of the RV to scroll through
@return the distance traveled by the RV in the transformation applied by this method.
+ is downward, - upward.
lib/src/main/java/com/turingtechnologies/materialscrollbar/ScrollingUtilities.java