How to get getFirstVisiblePosition()
and getChildAt(0)
in recyclerview
? Because I want to get position when user click item.
and code in listview is
index = listview.getFirstVisiblePosition();
View v = listview.getChildAt(0);
top = (v == null) ? 0 : (v.getTop() - listview.getPaddingTop());
but I want to use recyclerview.
How to set it?