Responsive Ad Area

Share This Post

test

How to get items currently shown in the screen of RecyclerView

Im building a news reader app which displays the list of news items in RecyclerView. I would like to mark the news to be automatically as read as the user vertically scrolls the recyclerview
1) I would like to know know the items which are currently displayed to the user in recyclerview

I tried with LayoutManager findFirstVisibleItemPosition and findLastVisibleItemPosition. These methods display index of what is displayed. Like an array index.

However I wanted to know the value associated with the firstVisibleItemPosition and findLastVisibleItemPosition so that I can mark the newsitem displayed from the first to last as read. Highly appreciate your suggestion on this.


How to get items currently shown in the screen of RecyclerView
How to get items currently shown in the screen of RecyclerView
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar