'Get pixels of a recyclerView item

I'm wondering if it's possible to get the pixels of an item of a recyclerView, let's say I have an horizontal recyclerView and all the items are the same size (from now), I'd like to know if it's possible to get the pixels of each item and detect the % in pixels of visibility of every item.

To have if it's visible I'm using this :

private boolean isViewVisible(View view, NestedScrollView scrollView) {
    Rect scrollBounds = new Rect();
    scrollView.getDrawingRect(scrollBounds);
    float top = view.getY();
    float bottom = top + view.getHeight();
    return scrollBounds.top < top && scrollBounds.bottom > bottom;
}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source