diff --git a/react/features/filmstrip/components/native/TileView.js b/react/features/filmstrip/components/native/TileView.js index e1ecc623c..4db56fb89 100644 --- a/react/features/filmstrip/components/native/TileView.js +++ b/react/features/filmstrip/components/native/TileView.js @@ -3,9 +3,10 @@ import React, { PureComponent } from 'react'; import { FlatList, - TouchableWithoutFeedback, - View + SafeAreaView, + TouchableWithoutFeedback } from 'react-native'; +import { withSafeAreaInsets } from 'react-native-safe-area-context'; import type { Dispatch } from 'redux'; import { getLocalParticipant, getParticipantCountWithFake } from '../../../base/participants'; @@ -71,6 +72,11 @@ type Props = { */ dispatch: Dispatch, + /** + * Object containing the safe area insets. + */ + insets: Object, + /** * Callback to invoke when tile view is tapped. */ @@ -126,7 +132,8 @@ class TileView extends PureComponent { ...styles.flatListTileView }; this._contentContainerStyles = { - ...styles.contentContainer + ...styles.contentContainer, + paddingBottom: this.props.insets?.bottom || 0 }; } @@ -194,13 +201,14 @@ class TileView extends PureComponent { this._contentContainerStyles = { ...styles.contentContainer, minHeight: _height, - minWidth: _width + minWidth: _width, + paddingBottom: this.props.insets?.bottom || 0 }; } return ( - + { style = { this._flatListStyles } viewabilityConfig = { this._viewabilityConfig } windowSize = { 2 } /> - + ); } @@ -269,10 +277,11 @@ class TileView extends PureComponent { * Maps (parts of) the redux state to the associated {@code TileView}'s props. * * @param {Object} state - The redux state. + * @param {Object} ownProps - Component props. * @private * @returns {Props} */ -function _mapStateToProps(state) { +function _mapStateToProps(state, ownProps) { const responsiveUi = state['features/base/responsive-ui']; const { remoteParticipants, tileViewDimensions } = state['features/filmstrip']; const disableSelfView = shouldHideSelfView(state); @@ -283,13 +292,14 @@ function _mapStateToProps(state) { _aspectRatio: responsiveUi.aspectRatio, _columns: columns, _disableSelfView: disableSelfView, - _height: responsiveUi.clientHeight, + _height: responsiveUi.clientHeight - (ownProps.insets?.top || 0), + _insets: ownProps.insets, _localParticipant: getLocalParticipant(state), _participantCount: getParticipantCountWithFake(state), _remoteParticipants: remoteParticipants, _thumbnailHeight: height, - _width: responsiveUi.clientWidth + _width: responsiveUi.clientWidth - (ownProps.insets?.right || 0) - (ownProps.insets?.left || 0) }; } -export default connect(_mapStateToProps)(TileView); +export default withSafeAreaInsets(connect(_mapStateToProps)(TileView));