Recyclerlistview: onVisibleIndexesChanged problem video

Created on 10 Dec 2018  路  8Comments  路  Source: Flipkart/recyclerlistview

Hello, thank you for an excellent component. I'm handling the onVisibleIndexesChanged event to be able to play a video or stop it, but I have a problem I'd like to be able to stop it when the red box hides, but the callback goes off when the blue box hides. I know that the size I use in the layoutProvider is bigger but how could I handle this situation?

28

Video: https://youtu.be/5mkclrVGjvg

Most helpful comment

FlatList has the "viewabilityConfig" prop in which you can specify "viewAreaCoveragePercentThreshold" and "itemVisiblePercentThreshold" where you can define what percentage of a visible item is considered to trigger viewability callback. I was looking in source code (because I need it too) and I found that this prop is in TODO list https://github.com/Flipkart/recyclerlistview/blob/master/src/core/RecyclerListView.tsx#L17

All 8 comments

FlatList has the "viewabilityConfig" prop in which you can specify "viewAreaCoveragePercentThreshold" and "itemVisiblePercentThreshold" where you can define what percentage of a visible item is considered to trigger viewability callback. I was looking in source code (because I need it too) and I found that this prop is in TODO list https://github.com/Flipkart/recyclerlistview/blob/master/src/core/RecyclerListView.tsx#L17

thanks I try and comment

@evilchis94 not work. Can you write a example code ?

@evilchis94 not work. Can you write a example code ?

it's not implemented yet

Any pointers on how we might implement "viewAreaCoveragePercentThreshold" and "itemVisiblePercentThreshold" if we dug into the codebase? We need this too.

@pribeh +1, I also need this and will be glad to implement it.

I tried to find where is the index calculated. It seem to happen here

@naqvitalha Does the value in findFirstVisibleIndexUsingBS(0.001), that @omerman points to, impact the visibility area of the list item for onVisibleIndexesChanged? If so, how could we expose this value as a props?

const relevantIndex = this._findFirstVisibleIndexUsingBS(0.001);

@leifermendez @evilchis94 Any luck for this problem?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ardyfeb picture ardyfeb  路  6Comments

ErHarinderSingh picture ErHarinderSingh  路  6Comments

teryi picture teryi  路  5Comments

VilleKokkarinen picture VilleKokkarinen  路  6Comments

witalobenicio picture witalobenicio  路  8Comments