I need to have first row(and values of row) always when I scrolling.
I have a RecyclerViewI need that when I scrolling my recycle and when arrive Row eight to position of Row one I visible a TextView for shown a something, for example a Title. How I can mange it?
For example when yellow row arrive to position of row green I visible a TextView.

I don't know how I can get position first row of Layout from Activity.
NOTICE : I don't need to use libraries of GitHub. Thanks
first / last visible child depends on the LayoutManager. If you are using LinearLayoutManager or GridLayoutManager, you can use
int findFirstVisibleItemPosition();
int findFirstCompletelyVisibleItemPosition();
int findLastVisibleItemPosition();
int findLastCompletelyVisibleItemPosition();
For example:
GridLayoutManager layoutManager = ((GridLayoutManager)mRecyclerView.getLayoutManager());
int firstVisiblePosition = layoutManager.findFirstVisibleItemPosition();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With