fix(rn,filmstrip) avoid fast scroll trigggering visibility notifications

An item won't be considered visible until it has been visible for 500ms.
This commit is contained in:
Saúl Ibarra Corretgé 2021-08-31 16:24:14 +02:00 committed by Saúl Ibarra Corretgé
parent 8db6e783f1
commit 36f604aab8
2 changed files with 6 additions and 2 deletions

View File

@ -95,8 +95,10 @@ class Filmstrip extends PureComponent<Props> {
this._separateLocalThumbnail = Platform.OS !== 'android';
this._viewabilityConfig = {
itemVisiblePercentThreshold: 30
itemVisiblePercentThreshold: 30,
minimumViewTime: 500
};
this._keyExtractor = this._keyExtractor.bind(this);
this._getItemLayout = this._getItemLayout.bind(this);
this._onViewableItemsChanged = this._onViewableItemsChanged.bind(this);

View File

@ -111,8 +111,10 @@ class TileView extends PureComponent<Props> {
this._keyExtractor = this._keyExtractor.bind(this);
this._onViewableItemsChanged = this._onViewableItemsChanged.bind(this);
this._renderThumbnail = this._renderThumbnail.bind(this);
this._viewabilityConfig = {
itemVisiblePercentThreshold: 30
itemVisiblePercentThreshold: 30,
minimumViewTime: 500
};
this._flatListStyles = {
...styles.flatListTileView