Recyclerlistview: Viewability feature events

Created on 9 Apr 2018  路  8Comments  路  Source: Flipkart/recyclerlistview

How can I detect the current item is active in recyclerlistview (visible on screen)?

Most helpful comment

You method should be visibleLog(all, now, notNow) RLV will call it with right params (those are arrays btw). After having the right indexes you can do whatever you want. If you want data fetch from your DataProvider using the given indexes.

All 8 comments

Please check the onVisibleIndexesChanged callback. It gives you all, now, notNow all that you might need. Close if that's what you were looking for.

Thanks for quick reply!

Can you please provide sample code for that?

I got that with:
<RecyclerListView onVisibleIndexesChanged={this.visibleLog.bind(this)} layoutProvider={this._layoutProvider} dataProvider={this.state.dataProvider} rowRenderer={this._rowRenderer} />

How can I get all, now, notNow?

thanks for your awesome library

You method should be visibleLog(all, now, notNow) RLV will call it with right params (those are arrays btw). After having the right indexes you can do whatever you want. If you want data fetch from your DataProvider using the given indexes.

Kindly please tell me how can I update the items viewable to screen

like changing text to "shown" while viewing

You need to update the data using those indexes and re-render. RLV will/cannot give you direct references.

Can you explain more about

using those indexes and re-render.

I couldn't find any document for re-render them

That is normal react-redux stuff. You fire an action which ultimately modifies the state.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sm2017 picture sm2017  路  5Comments

jacquesdev picture jacquesdev  路  6Comments

gilra2000 picture gilra2000  路  6Comments

ErHarinderSingh picture ErHarinderSingh  路  6Comments

sksin28 picture sksin28  路  8Comments